mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
AModule::getScrollDir: convert reset if-else into switch
This commit is contained in:
parent
86d6668ed4
commit
12b30ca25f
@ -79,11 +79,19 @@ AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
|
||||
dir = SCROLL_DIR::LEFT;
|
||||
}
|
||||
|
||||
if (dir == SCROLL_DIR::UP || dir == SCROLL_DIR::DOWN) {
|
||||
distance_scrolled_y_ = 0;
|
||||
} else if (dir == SCROLL_DIR::LEFT || dir == SCROLL_DIR::RIGHT) {
|
||||
distance_scrolled_x_ = 0;
|
||||
switch (dir) {
|
||||
case SCROLL_DIR::UP:
|
||||
case SCROLL_DIR::DOWN:
|
||||
distance_scrolled_y_ = 0;
|
||||
break;
|
||||
case SCROLL_DIR::LEFT:
|
||||
case SCROLL_DIR::RIGHT:
|
||||
distance_scrolled_x_ = 0;
|
||||
break;
|
||||
case SCROLL_DIR::NONE:
|
||||
break;
|
||||
}
|
||||
|
||||
return dir;
|
||||
}
|
||||
// Silence -Wreturn-type:
|
||||
|
Loading…
Reference in New Issue
Block a user