Merge lp:~3v1n0/unity-2d/scroll-event-support into lp:unity-2d/3.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Aurélien Gâteau
Approved revision: 616
Merged at revision: 636
Proposed branch: lp:~3v1n0/unity-2d/scroll-event-support
Merge into: lp:unity-2d/3.0
Diff against target: 32 lines (+15/-0)
1 file modified
panel/applets/indicator/indicator.c (+15/-0)
To merge this branch: bzr merge lp:~3v1n0/unity-2d/scroll-event-support
Reviewer Review Type Date Requested Status
Aurélien Gâteau (community) Approve
Review via email: mp+66543@code.launchpad.net

Description of the change

Added scroll-event support for unity-2d-panel, using the same code I wrote for indicator-applet (which I forgot to port to unity-2d too at the time).

Scrolling over the indicator-sound (and other 3rd party indicators which support the scrolling signal) will now work.

To post a comment you must log in.
Revision history for this message
Aurélien Gâteau (agateau) wrote :

Looks good, thanks for the patch!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panel/applets/indicator/indicator.c'
2--- panel/applets/indicator/indicator.c 2011-03-30 14:50:35 +0000
3+++ panel/applets/indicator/indicator.c 2011-07-01 04:16:29 +0000
4@@ -152,6 +152,20 @@
5 return;
6 }
7
8+static gboolean
9+entry_scrolled (GtkWidget *menuitem, GdkEventScroll *event, gpointer data)
10+{
11+ IndicatorObject *io = g_object_get_data (G_OBJECT (menuitem), MENU_DATA_INDICATOR_OBJECT);
12+ IndicatorObjectEntry *entry = g_object_get_data (G_OBJECT (menuitem), MENU_DATA_INDICATOR_ENTRY);
13+
14+ g_return_val_if_fail(INDICATOR_IS_OBJECT(io), FALSE);
15+
16+ g_signal_emit_by_name (io, "scroll", 1, event->direction);
17+ g_signal_emit_by_name (io, "scroll-entry", entry, 1, event->direction);
18+
19+ return FALSE;
20+}
21+
22 static void
23 entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar)
24 {
25@@ -233,6 +247,7 @@
26
27 g_object_set_data(G_OBJECT(menuitem), MENU_DATA_INDICATOR_ENTRY, entry);
28 g_object_set_data(G_OBJECT(menuitem), MENU_DATA_INDICATOR_OBJECT, io);
29+ g_signal_connect(G_OBJECT (menuitem), "scroll-event", G_CALLBACK(entry_scrolled), NULL);
30
31 return;
32 }

Subscribers

People subscribed via source and target branches