Skip to content

Commit

Permalink
Merge pull request #3142 from janpeterd/master
Browse files Browse the repository at this point in the history
calendar: add shift_reset action
  • Loading branch information
Alexays authored Apr 15, 2024
2 parents fbcd7eb + fb88c06 commit 3efebc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/modules/clock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ class Clock final : public ALabel {
void cldModeSwitch();
void cldShift_up();
void cldShift_down();
void cldShift_reset();

Check warning on line 76 in include/modules/clock.hpp

View workflow job for this annotation

GitHub Actions / build

include/modules/clock.hpp:76:8 [readability-identifier-naming]

invalid case style for function 'cldShift_reset'
void tz_up();

Check warning on line 77 in include/modules/clock.hpp

View workflow job for this annotation

GitHub Actions / build

include/modules/clock.hpp:77:8 [readability-identifier-naming]

invalid case style for function 'tz_up'
void tz_down();
// Module Action Map
static inline std::map<const std::string, void (waybar::modules::Clock::*const)()> actionMap_{
{"mode", &waybar::modules::Clock::cldModeSwitch},
{"shift_up", &waybar::modules::Clock::cldShift_up},
{"shift_down", &waybar::modules::Clock::cldShift_down},
{"shift_reset", &waybar::modules::Clock::cldShift_reset},
{"tz_up", &waybar::modules::Clock::tz_up},
{"tz_down", &waybar::modules::Clock::tz_down}};
};
Expand Down
3 changes: 3 additions & 0 deletions src/modules/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ void waybar::modules::Clock::cldShift_up() {
void waybar::modules::Clock::cldShift_down() {
cldCurrShift_ -= (months)((cldMode_ == CldMode::YEAR) ? 12 : 1) * cldShift_;
}
void waybar::modules::Clock::cldShift_reset() {
cldCurrShift_ = (months)0;
}
void waybar::modules::Clock::tz_up() {
const auto tzSize{tzList_.size()};
if (tzSize == 1) return;
Expand Down

0 comments on commit 3efebc2

Please sign in to comment.