diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-13 09:44:58 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-13 09:44:58 -0500 |
commit | 9915201124a950ec4b9a3c34f1f34057d72dfced (patch) | |
tree | 6f224d58fc3bbedf9650eb6720de3127711592e3 /src | |
parent | 9b02ced3494a7d62db3435e7c8cbefc3d2f024f2 (diff) | |
parent | 8722b2b1040d504e822a7105c3c4ff2c0fa0d043 (diff) | |
download | ayatana-ido-9915201124a950ec4b9a3c34f1f34057d72dfced.tar.gz ayatana-ido-9915201124a950ec4b9a3c34f1f34057d72dfced.tar.bz2 ayatana-ido-9915201124a950ec4b9a3c34f1f34057d72dfced.zip |
merge lp:~charlesk/ido/lp-898611 to fix lp bug #898611
Diffstat (limited to 'src')
-rw-r--r-- | src/idoscalemenuitem.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c index fd8d320..4174b9d 100644 --- a/src/idoscalemenuitem.c +++ b/src/idoscalemenuitem.c @@ -217,6 +217,21 @@ ido_scale_menu_item_toggle_size_allocate (IdoScaleMenuItem *item, priv->toggle_size = toggle_size; } +static gboolean +on_scale_button_press_or_release_event (GtkWidget * widget G_GNUC_UNUSED, + GdkEventButton * event, + gpointer unused G_GNUC_UNUSED) +{ + /* HACK: we want the behaviour you get with the middle button, so we + * mangle the event. clicking with other buttons moves the slider in + * step increments, clicking with the middle button moves the slider to + * the location of the click. */ + if (event->button == 1) + event->button = 2; + + return FALSE; +} + static void ido_scale_menu_item_constructed (GObject *object) { @@ -235,6 +250,11 @@ ido_scale_menu_item_constructed (GObject *object) priv->scale = ido_range_new (adj, range_style); g_object_ref (priv->scale); gtk_scale_set_draw_value (GTK_SCALE (priv->scale), FALSE); + g_signal_connect (G_OBJECT (priv->scale), "button-press-event", + G_CALLBACK (on_scale_button_press_or_release_event), NULL); + g_signal_connect (G_OBJECT (priv->scale), "button-release-event", + G_CALLBACK (on_scale_button_press_or_release_event), NULL); + #ifdef USE_GTK3 hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); |