forked from AuroraMiddleware/gtk
gtk-demo: Stop emitting ::popup-menu
The signal was not used anyway, in the font explorer demo.
This commit is contained in:
parent
f40965cc40
commit
98011e6273
@ -140,17 +140,6 @@ update_value (GtkFontPlane *plane,
|
|||||||
gtk_widget_queue_draw (widget);
|
gtk_widget_queue_draw (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
hold_action (GtkGestureLongPress *gesture,
|
|
||||||
gdouble x,
|
|
||||||
gdouble y,
|
|
||||||
GtkFontPlane *plane)
|
|
||||||
{
|
|
||||||
gboolean handled;
|
|
||||||
|
|
||||||
g_signal_emit_by_name (plane, "popup-menu", &handled);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
plane_drag_gesture_begin (GtkGestureDrag *gesture,
|
plane_drag_gesture_begin (GtkGestureDrag *gesture,
|
||||||
gdouble start_x,
|
gdouble start_x,
|
||||||
@ -161,13 +150,6 @@ plane_drag_gesture_begin (GtkGestureDrag *gesture,
|
|||||||
|
|
||||||
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
||||||
|
|
||||||
if (button == GDK_BUTTON_SECONDARY)
|
|
||||||
{
|
|
||||||
gboolean handled;
|
|
||||||
|
|
||||||
g_signal_emit_by_name (plane, "popup-menu", &handled);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (button != GDK_BUTTON_PRIMARY)
|
if (button != GDK_BUTTON_PRIMARY)
|
||||||
{
|
{
|
||||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
|
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
|
||||||
@ -218,13 +200,6 @@ gtk_font_plane_init (GtkFontPlane *plane)
|
|||||||
G_CALLBACK (plane_drag_gesture_end), plane);
|
G_CALLBACK (plane_drag_gesture_end), plane);
|
||||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
|
||||||
gtk_widget_add_controller (GTK_WIDGET (plane), GTK_EVENT_CONTROLLER (gesture));
|
gtk_widget_add_controller (GTK_WIDGET (plane), GTK_EVENT_CONTROLLER (gesture));
|
||||||
|
|
||||||
gesture = gtk_gesture_long_press_new ();
|
|
||||||
g_signal_connect (gesture, "pressed",
|
|
||||||
G_CALLBACK (hold_action), plane);
|
|
||||||
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture),
|
|
||||||
TRUE);
|
|
||||||
gtk_widget_add_controller (GTK_WIDGET (plane), GTK_EVENT_CONTROLLER (gesture));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user