Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calendar: add shift_reset action #3142

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Loading