aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-07-16 15:00:51 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-07-16 15:00:51 +0200
commit515f71772aabb6537a6549ebe4ed24d52a3ffdf9 (patch)
tree5118b4996d4248692ce736f3fb9dd6c964fd183f
parent14a8261fa665d98b030ea7e6f1060ed281e13845 (diff)
downloadlibayatana-indicator-515f71772aabb6537a6549ebe4ed24d52a3ffdf9.tar.gz
libayatana-indicator-515f71772aabb6537a6549ebe4ed24d52a3ffdf9.tar.bz2
libayatana-indicator-515f71772aabb6537a6549ebe4ed24d52a3ffdf9.zip
IndicatorLoader: add scroll-entry support
-rw-r--r--tools/indicator-loader.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c
index 153cca7..8fee29b 100644
--- a/tools/indicator-loader.c
+++ b/tools/indicator-loader.c
@@ -55,6 +55,27 @@ activate_entry (GtkWidget * widget, gpointer user_data)
}
}
+static void
+scroll_entry (GtkWidget *widget, GdkEventScroll* event, gpointer user_data)
+{
+ gpointer entry;
+
+ g_return_if_fail (INDICATOR_IS_OBJECT(user_data));
+
+ entry = g_object_get_qdata (G_OBJECT(widget), entry_data_quark());
+
+ if (entry == NULL)
+ {
+ g_debug("Scroll on: (null)");
+ }
+ else
+ {
+ g_signal_emit_by_name(INDICATOR_OBJECT(user_data),
+ INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED,
+ entry, 1, event->direction);
+ }
+}
+
static GtkWidget*
create_menu_item (IndicatorObjectEntry * entry)
{
@@ -106,6 +127,9 @@ entry_added (IndicatorObject * io,
g_object_set_qdata (G_OBJECT(menu_item), entry_data_quark(), entry);
g_signal_connect (menu_item, "activate", G_CALLBACK(activate_entry), io);
+ gtk_widget_set_events (menu_item, gtk_widget_get_events (menu_item) | GDK_SCROLL_MASK);
+ g_signal_connect (menu_item, "scroll-event", G_CALLBACK(scroll_entry), io);
+
gtk_menu_shell_append (GTK_MENU_SHELL(user_data), menu_item);
}