aboutsummaryrefslogtreecommitdiff
path: root/src/menubar.vala
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-11-04 07:32:17 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-11-04 07:32:17 +0100
commit80d54d1de44505ca2a0141202dce64b26d2817fd (patch)
treee79db375026c87f5a4228662c82db64e4a53e7d2 /src/menubar.vala
parentb6e2c6dd2adfc8f266be349c1a1824e9bd21d0aa (diff)
parentbbd3412b02e54c611d6e660e94179e22d0ff4338 (diff)
downloadarctica-greeter-80d54d1de44505ca2a0141202dce64b26d2817fd.tar.gz
arctica-greeter-80d54d1de44505ca2a0141202dce64b26d2817fd.tar.bz2
arctica-greeter-80d54d1de44505ca2a0141202dce64b26d2817fd.zip
Merge branch 'tari01-pr/add-scroll'
Attributes GH PR #91: https://github.com/ArcticaProject/arctica-greeter/pull/91
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);
}