mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
Merge pull request #3142 from janpeterd/master
calendar: add shift_reset action
This commit is contained in:
@ -73,6 +73,7 @@ class Clock final : public ALabel {
|
|||||||
void cldModeSwitch();
|
void cldModeSwitch();
|
||||||
void cldShift_up();
|
void cldShift_up();
|
||||||
void cldShift_down();
|
void cldShift_down();
|
||||||
|
void cldShift_reset();
|
||||||
void tz_up();
|
void tz_up();
|
||||||
void tz_down();
|
void tz_down();
|
||||||
// Module Action Map
|
// Module Action Map
|
||||||
@ -80,6 +81,7 @@ class Clock final : public ALabel {
|
|||||||
{"mode", &waybar::modules::Clock::cldModeSwitch},
|
{"mode", &waybar::modules::Clock::cldModeSwitch},
|
||||||
{"shift_up", &waybar::modules::Clock::cldShift_up},
|
{"shift_up", &waybar::modules::Clock::cldShift_up},
|
||||||
{"shift_down", &waybar::modules::Clock::cldShift_down},
|
{"shift_down", &waybar::modules::Clock::cldShift_down},
|
||||||
|
{"shift_reset", &waybar::modules::Clock::cldShift_reset},
|
||||||
{"tz_up", &waybar::modules::Clock::tz_up},
|
{"tz_up", &waybar::modules::Clock::tz_up},
|
||||||
{"tz_down", &waybar::modules::Clock::tz_down}};
|
{"tz_down", &waybar::modules::Clock::tz_down}};
|
||||||
};
|
};
|
||||||
|
@ -423,6 +423,9 @@ void waybar::modules::Clock::cldShift_up() {
|
|||||||
void waybar::modules::Clock::cldShift_down() {
|
void waybar::modules::Clock::cldShift_down() {
|
||||||
cldCurrShift_ -= (months)((cldMode_ == CldMode::YEAR) ? 12 : 1) * cldShift_;
|
cldCurrShift_ -= (months)((cldMode_ == CldMode::YEAR) ? 12 : 1) * cldShift_;
|
||||||
}
|
}
|
||||||
|
void waybar::modules::Clock::cldShift_reset() {
|
||||||
|
cldCurrShift_ = (months)0;
|
||||||
|
}
|
||||||
void waybar::modules::Clock::tz_up() {
|
void waybar::modules::Clock::tz_up() {
|
||||||
const auto tzSize{tzList_.size()};
|
const auto tzSize{tzList_.size()};
|
||||||
if (tzSize == 1) return;
|
if (tzSize == 1) return;
|
||||||
|
Reference in New Issue
Block a user