summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-02-03 01:41:07 -0500
committerMatthias Clasen <mclasen@redhat.com>2012-02-14 16:36:53 -0500
commitcd300835d76381c4ad16a9c87e305199a284f7fa (patch)
treef482c4e67296c96a4607fdb3340aca0e9033f35a /gtk/gtkrange.c
parente56adaebeaef25365c46cdecdce8bbc741debdb1 (diff)
downloadgtk+-cd300835d76381c4ad16a9c87e305199a284f7fa.tar.gz
Allow context menus on scale sliders
This will be used for a popup in the color chooser.
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r--gtk/gtkrange.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index ddd669cb74..14c72f9d2a 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2548,6 +2548,16 @@ gtk_range_button_press (GtkWidget *widget,
if (gtk_range_update_mouse_location (range))
gtk_widget_queue_draw (widget);
+ if (priv->mouse_location == MOUSE_SLIDER &&
+ gdk_event_triggers_context_menu ((GdkEvent *)event))
+ {
+ gboolean handled;
+
+ g_signal_emit_by_name (widget, "popup-menu", &handled);
+
+ return TRUE;
+ }
+
if (priv->mouse_location == MOUSE_TROUGH &&
event->button == GDK_BUTTON_PRIMARY)
{