[gtk+] gtkflowbox: Activate items on ::unpaired-release
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkflowbox: Activate items on ::unpaired-release
- Date: Mon, 27 Nov 2017 00:52:42 +0000 (UTC)
commit 0567b41f2458c4025e883809c8b96cc5df464d79
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 21 22:35:31 2017 +0100
gtkflowbox: Activate items on ::unpaired-release
If the flowbox is single-click.
https://bugzilla.gnome.org/show_bug.cgi?id=789163
gtk/gtkflowbox.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index 6073b71..95f89ca 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -2675,6 +2675,26 @@ gtk_flow_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
}
static void
+gtk_flow_box_multipress_unpaired_release (GtkGestureMultiPress *gesture,
+ gdouble x,
+ gdouble y,
+ guint button,
+ GdkEventSequence *sequence,
+ GtkFlowBox *box)
+{
+ GtkFlowBoxPrivate *priv = BOX_PRIV (box);
+ GtkFlowBoxChild *child;
+
+ if (!priv->activate_on_single_click)
+ return;
+
+ child = gtk_flow_box_get_child_at_pos (box, x, y);
+
+ if (child)
+ gtk_flow_box_select_and_activate (box, child);
+}
+
+static void
gtk_flow_box_multipress_gesture_released (GtkGestureMultiPress *gesture,
guint n_press,
gdouble x,
@@ -3718,6 +3738,8 @@ gtk_flow_box_init (GtkFlowBox *box)
G_CALLBACK (gtk_flow_box_multipress_gesture_released), box);
g_signal_connect (priv->multipress_gesture, "stopped",
G_CALLBACK (gtk_flow_box_multipress_gesture_stopped), box);
+ g_signal_connect (priv->multipress_gesture, "unpaired-release",
+ G_CALLBACK (gtk_flow_box_multipress_unpaired_release), box);
priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (box));
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->drag_gesture),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]