aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2023-11-04 13:30:53 +0100
committerRobert Tari <robert@tari.in>2023-11-04 13:30:53 +0100
commitdaec7e93b5f0f626b83e62b44071e71b29d74be8 (patch)
treec558edb3cc7269d13aa4acdc9bdaa7ecc6c37a4d /src
parent80d54d1de44505ca2a0141202dce64b26d2817fd (diff)
downloadarctica-greeter-daec7e93b5f0f626b83e62b44071e71b29d74be8.tar.gz
arctica-greeter-daec7e93b5f0f626b83e62b44071e71b29d74be8.tar.bz2
arctica-greeter-daec7e93b5f0f626b83e62b44071e71b29d74be8.zip
src/menubar.vala: Fix scroll direction value
Diffstat (limited to 'src')
-rw-r--r--src/menubar.vala13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/menubar.vala b/src/menubar.vala
index 03d15e1..7b1fb21 100644
--- a/src/menubar.vala
+++ b/src/menubar.vala
@@ -71,7 +71,18 @@ private class IndicatorMenuItem : Gtk.MenuItem
public bool scrolled_cb (Gtk.Widget pWidget, Gdk.EventScroll pEvent)
{
Indicator.Object pObject = pWidget.get_data ("indicator-object");
- GLib.Signal.emit_by_name (pObject, "entry-scrolled", 1, pEvent.direction);
+ int nDirection = 0;
+
+ if (pEvent.direction == Gdk.ScrollDirection.UP)
+ {
+ nDirection = 1;
+ }
+ else if (pEvent.direction == Gdk.ScrollDirection.DOWN)
+ {
+ nDirection = -1;
+ }
+
+ GLib.Signal.emit_by_name (pObject, "entry-scrolled", 1, nDirection);
return false;
}