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
=== modified file 'panel/applets/indicator/indicator.c'
--- panel/applets/indicator/indicator.c 2011-03-30 14:50:35 +0000
+++ panel/applets/indicator/indicator.c 2011-07-01 04:16:29 +0000
@@ -152,6 +152,20 @@
152 return;152 return;
153}153}
154154
155static gboolean
156entry_scrolled (GtkWidget *menuitem, GdkEventScroll *event, gpointer data)
157{
158 IndicatorObject *io = g_object_get_data (G_OBJECT (menuitem), MENU_DATA_INDICATOR_OBJECT);
159 IndicatorObjectEntry *entry = g_object_get_data (G_OBJECT (menuitem), MENU_DATA_INDICATOR_ENTRY);
160
161 g_return_val_if_fail(INDICATOR_IS_OBJECT(io), FALSE);
162
163 g_signal_emit_by_name (io, "scroll", 1, event->direction);
164 g_signal_emit_by_name (io, "scroll-entry", entry, 1, event->direction);
165
166 return FALSE;
167}
168
155static void169static void
156entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar)170entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar)
157{171{
@@ -233,6 +247,7 @@
233247
234 g_object_set_data(G_OBJECT(menuitem), MENU_DATA_INDICATOR_ENTRY, entry);248 g_object_set_data(G_OBJECT(menuitem), MENU_DATA_INDICATOR_ENTRY, entry);
235 g_object_set_data(G_OBJECT(menuitem), MENU_DATA_INDICATOR_OBJECT, io);249 g_object_set_data(G_OBJECT(menuitem), MENU_DATA_INDICATOR_OBJECT, io);
250 g_signal_connect(G_OBJECT (menuitem), "scroll-event", G_CALLBACK(entry_scrolled), NULL);
236251
237 return;252 return;
238}253}

Subscribers

People subscribed via source and target branches