]> Pileus Git - ~andy/gtk/commitdiff
Allow context menus on scale sliders
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 Feb 2012 06:41:07 +0000 (01:41 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 Feb 2012 21:36:53 +0000 (16:36 -0500)
This will be used for a popup in the color chooser.

gtk/gtkrange.c

index ddd669cb74024952d8759dc3285cd547dcfdee16..14c72f9d2a46664cb5b60f46a96384209464f389 100644 (file)
@@ -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)
     {