Commit 1c23ab5a authored by Carlos Garnacho's avatar Carlos Garnacho

colorswatch: Update to new GtkGestureSingle/GtkEventController defaults

GtkGestureSingle::button is set to 0 on the multipress gesture, as several
buttons are managed by that gesture. Also avoid some extra lines of code
setting what nowadays are default values.

https://bugzilla.gnome.org/show_bug.cgi?id=734285
parent 9e89640b
......@@ -89,17 +89,15 @@ gtk_color_swatch_init (GtkColorSwatch *swatch)
gtk_widget_set_has_window (GTK_WIDGET (swatch), FALSE);
swatch->priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (swatch));
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->long_press_gesture),
TRUE);
g_signal_connect (swatch->priv->long_press_gesture, "pressed",
G_CALLBACK (hold_action), swatch);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (swatch->priv->long_press_gesture),
GTK_PHASE_BUBBLE);
swatch->priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (swatch));
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->multipress_gesture), FALSE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (swatch->priv->multipress_gesture), 0);
g_signal_connect (swatch->priv->multipress_gesture, "pressed",
G_CALLBACK (tap_action), swatch);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (swatch->priv->multipress_gesture),
GTK_PHASE_BUBBLE);
}
#define INTENSITY(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment