Merge pull request #1841 from encbar5/inverted-date-scroll

This commit is contained in:
Alex 2022-11-28 07:43:48 +01:00 committed by GitHub
commit da3d9533d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ bool waybar::modules::Clock::handleScroll(GdkEventScroll* e) {
auto dir = AModule::getScrollDir(e);
// Shift calendar date
if (calendar_shift_init_.count() > 0) {
if (calendar_shift_init_.count() != 0) {
if (dir == SCROLL_DIR::UP)
calendar_shift_ += calendar_shift_init_;
else
@ -170,7 +170,7 @@ auto waybar::modules::Clock::calendar_text(const waybar_time& wtime) -> std::str
if (calendar_cached_ymd_ == ymd) return calendar_cached_text_;
const auto curr_day{(calendar_shift_init_.count() > 0 && calendar_shift_.count() != 0)
const auto curr_day{(calendar_shift_init_.count() != 0 && calendar_shift_.count() != 0)
? date::day{0}
: ymd.day()};
const date::year_month ym{ymd.year(), ymd.month()};