diff options
author | Robert Tari <robert@tari.in> | 2023-11-03 15:44:01 +0100 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2023-11-03 15:44:01 +0100 |
commit | bbd3412b02e54c611d6e660e94179e22d0ff4338 (patch) | |
tree | e79db375026c87f5a4228662c82db64e4a53e7d2 | |
parent | b6e2c6dd2adfc8f266be349c1a1824e9bd21d0aa (diff) | |
download | arctica-greeter-bbd3412b02e54c611d6e660e94179e22d0ff4338.tar.gz arctica-greeter-bbd3412b02e54c611d6e660e94179e22d0ff4338.tar.bz2 arctica-greeter-bbd3412b02e54c611d6e660e94179e22d0ff4338.zip |
src/menubar.vala: Add scroll signalling
-rw-r--r-- | src/menubar.vala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/menubar.vala b/src/menubar.vala index 6dd802b..03d15e1 100644 --- a/src/menubar.vala +++ b/src/menubar.vala @@ -33,6 +33,8 @@ private class IndicatorMenuItem : Gtk.MenuItem this.hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 3); this.add (this.hbox); this.hbox.show (); + this.add_events (Gdk.EventMask.SCROLL_MASK); + this.scroll_event.connect (this.scrolled_cb); if (entry.label != null) { @@ -65,6 +67,14 @@ private class IndicatorMenuItem : Gtk.MenuItem { visible = has_visible_child (); } + + 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); + + return false; + } } public class MenuBar : Gtk.MenuBar @@ -449,6 +459,7 @@ public class MenuBar : Gtk.MenuBar debug ("Adding indicator object %p at position %d", entry, pos); var menuitem = new IndicatorMenuItem (entry); + menuitem.set_data ("indicator-object", object); insert (menuitem, pos); } |