aboutsummaryrefslogtreecommitdiff
path: root/src/menubar.vala
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2023-11-03 15:44:01 +0100
committerRobert Tari <robert@tari.in>2023-11-03 15:44:01 +0100
commitbbd3412b02e54c611d6e660e94179e22d0ff4338 (patch)
treee79db375026c87f5a4228662c82db64e4a53e7d2 /src/menubar.vala
parentb6e2c6dd2adfc8f266be349c1a1824e9bd21d0aa (diff)
downloadarctica-greeter-bbd3412b02e54c611d6e660e94179e22d0ff4338.tar.gz
arctica-greeter-bbd3412b02e54c611d6e660e94179e22d0ff4338.tar.bz2
arctica-greeter-bbd3412b02e54c611d6e660e94179e22d0ff4338.zip
src/menubar.vala: Add scroll signalling
Diffstat (limited to 'src/menubar.vala')
-rw-r--r--src/menubar.vala11
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);
}