mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
AModule::getScrollDir: get deltas in a more C++ way
This commit is contained in:
parent
2c038d1977
commit
7c85aec8e0
@ -63,10 +63,9 @@ AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
|
||||
return SCROLL_DIR::RIGHT;
|
||||
} else if (e->direction == GDK_SCROLL_SMOOTH) {
|
||||
SCROLL_DIR dir{SCROLL_DIR::NONE};
|
||||
gdouble delta_x, delta_y;
|
||||
gdk_event_get_scroll_deltas(reinterpret_cast<const GdkEvent*>(e), &delta_x, &delta_y);
|
||||
distance_scrolled_y_ += delta_y;
|
||||
distance_scrolled_x_ += delta_x;
|
||||
|
||||
distance_scrolled_y_ += e->delta_y;
|
||||
distance_scrolled_x_ += e->delta_x;
|
||||
|
||||
gdouble threshold = 0;
|
||||
if (config_["smooth-scrolling-threshold"].isNumeric()) {
|
||||
|
Loading…
Reference in New Issue
Block a user