diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-03-19 18:03:16 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-03-19 18:03:16 -0400 |
commit | 31db61588543a1ba0935ac8ecb2ecac574c0a836 (patch) | |
tree | a2e2092e086a9c7d618e2c9ae1fc7b5a659e8a7a /gtk/gtkcolorscale.c | |
parent | 3ac4c76b18cc89a841ce09f0943539f16988fd21 (diff) | |
download | gtk+-31db61588543a1ba0935ac8ecb2ecac574c0a836.tar.gz |
Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18cc89a841ce09f0943539f16988fd21, reversing
changes made to 6ec96d2e989d029a303b8b20ec72b86f974c0e87.
Diffstat (limited to 'gtk/gtkcolorscale.c')
-rw-r--r-- | gtk/gtkcolorscale.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/gtk/gtkcolorscale.c b/gtk/gtkcolorscale.c index 56d120b111..d4bc48452a 100644 --- a/gtk/gtkcolorscale.c +++ b/gtk/gtkcolorscale.c @@ -29,10 +29,6 @@ #include "gtkprivate.h" #include "gtkintl.h" #include "gtksnapshot.h" -#include "gtkshortcutcontroller.h" -#include "gtkshortcuttrigger.h" -#include "gtkshortcutaction.h" -#include "gtkshortcut.h" #include <math.h> @@ -52,7 +48,7 @@ enum static void hold_action (GtkGestureLongPress *gesture, gdouble x, gdouble y, - GtkWidget *scale); + GtkColorScale *scale); G_DEFINE_TYPE_WITH_PRIVATE (GtkColorScale, gtk_color_scale, GTK_TYPE_SCALE) @@ -165,29 +161,6 @@ gtk_color_scale_init (GtkColorScale *scale) } static void -scale_constructed (GObject *object) -{ - GtkColorScale *scale = GTK_COLOR_SCALE (object); - GtkColorScalePrivate *priv = gtk_color_scale_get_instance_private (scale); - GtkEventController *controller; - GtkShortcutTrigger *trigger; - GtkShortcutAction *action; - GtkShortcut *shortcut; - - controller = gtk_shortcut_controller_new (); - trigger = gtk_alternative_trigger_new (gtk_keyval_trigger_new (GDK_KEY_F10, GDK_SHIFT_MASK), - gtk_keyval_trigger_new (GDK_KEY_Menu, 0)); - action = gtk_action_action_new ("color.edit"); - shortcut = gtk_shortcut_new_with_arguments (trigger, - action, - "s", - priv->type == GTK_COLOR_SCALE_ALPHA - ? "a" : "h"); - gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut); - gtk_widget_add_controller (GTK_WIDGET (scale), controller); -} - -static void scale_get_property (GObject *object, guint prop_id, GValue *value, @@ -250,11 +223,11 @@ static void hold_action (GtkGestureLongPress *gesture, gdouble x, gdouble y, - GtkWidget *scale) + GtkColorScale *scale) { - gtk_widget_activate_action (scale, - "color.edit", - "s", gtk_widget_get_name (scale)); + gboolean handled; + + g_signal_emit_by_name (scale, "popup-menu", &handled); } static void @@ -272,7 +245,6 @@ gtk_color_scale_class_init (GtkColorScaleClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - object_class->constructed = scale_constructed; object_class->finalize = scale_finalize; object_class->get_property = scale_get_property; object_class->set_property = scale_set_property; @@ -281,7 +253,6 @@ gtk_color_scale_class_init (GtkColorScaleClass *class) g_param_spec_int ("scale-type", P_("Scale type"), P_("Scale type"), 0, 1, 0, GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - } void |