Merge lp:~bratsche/ido/reverse-scroll-events into lp:ido/0.3

Proposed by Cody Russell
Status: Merged
Merged at revision: not available
Proposed branch: lp:~bratsche/ido/reverse-scroll-events
Merge into: lp:ido/0.3
Diff against target: 70 lines (+25/-2)
1 file modified
src/idoscalemenuitem.c (+25/-2)
To merge this branch: bzr merge lp:~bratsche/ido/reverse-scroll-events
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+19256@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Cody Russell (bratsche) wrote :

This branch allows the scale menuitem to support reversing scroll events. By default the scrollwheel-up is moving the scale direction to the left and, in indicator-sound, causing the volume to go down.

Revision history for this message
Conor Curran (cjcurran) wrote :

Necessary for the indicator-sound spec.

Revision history for this message
Conor Curran (cjcurran) wrote :

Necessary for the indicator-sound spec.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/idoscalemenuitem.c'
2--- src/idoscalemenuitem.c 2010-02-11 23:09:46 +0000
3+++ src/idoscalemenuitem.c 2010-02-13 06:46:16 +0000
4@@ -66,11 +66,13 @@
5 GtkAllocation child_allocation;
6 gdouble left_padding;
7 gdouble right_padding;
8+ gboolean reverse_scroll;
9 };
10
11 enum {
12 PROP_0,
13- PROP_ADJUSTMENT
14+ PROP_ADJUSTMENT,
15+ PROP_REVERSE_SCROLL_EVENTS
16 };
17
18 G_DEFINE_TYPE (IdoScaleMenuItem, ido_scale_menu_item, GTK_TYPE_MENU_ITEM)
19@@ -88,7 +90,13 @@
20 ido_scale_menu_item_scroll_event (GtkWidget *menuitem,
21 GdkEventScroll *event)
22 {
23- GtkWidget *scale = GET_PRIVATE (IDO_SCALE_MENU_ITEM (menuitem))->scale;
24+ IdoScaleMenuItemPrivate *priv = GET_PRIVATE (menuitem);
25+ GtkWidget *scale = priv->scale;
26+
27+ if (priv->reverse_scroll)
28+ {
29+ event->direction = !event->direction;
30+ }
31
32 gtk_widget_event (scale,
33 ((GdkEvent *)(void*)(event)));
34@@ -174,6 +182,14 @@
35 GTK_TYPE_ADJUSTMENT,
36 G_PARAM_READWRITE));
37
38+ g_object_class_install_property (gobject_class,
39+ PROP_REVERSE_SCROLL_EVENTS,
40+ g_param_spec_boolean ("reverse-scroll-events",
41+ "Reverse scroll events",
42+ "Reverses how scroll events are interpreted",
43+ FALSE,
44+ G_PARAM_READWRITE));
45+
46 g_type_class_add_private (object_class, sizeof (IdoScaleMenuItemPrivate));
47 }
48
49@@ -199,7 +215,10 @@
50 {
51 case PROP_ADJUSTMENT:
52 gtk_range_set_adjustment (GTK_RANGE (priv->scale), g_value_get_object (value));
53+ break;
54
55+ case PROP_REVERSE_SCROLL_EVENTS:
56+ priv->reverse_scroll = g_value_get_boolean (value);
57 break;
58
59 default:
60@@ -224,6 +243,10 @@
61 g_value_set_object (value, adjustment);
62 break;
63
64+ case PROP_REVERSE_SCROLL_EVENTS:
65+ g_value_set_boolean (value, priv->reverse_scroll);
66+ break;
67+
68 default:
69 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
70 break;

Subscribers

People subscribed via source and target branches

to all changes: