summaryrefslogtreecommitdiff
path: root/gtk/gtktreeviewcolumn.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-02-27 22:42:27 -0500
committerMatthias Clasen <mclasen@redhat.com>2019-02-28 00:36:44 -0500
commitfda4546de522008de734d26e9d3a583e724c8671 (patch)
treea85421f207109930c746280afa76d8af0f730a8b /gtk/gtktreeviewcolumn.c
parentfe7dcf6eec844ec17866584bb615ab603f0389fd (diff)
downloadgtk+-fda4546de522008de734d26e9d3a583e724c8671.tar.gz
treeview: Stop using set_focus_child
Do this with an event controller on the buttons instead.
Diffstat (limited to 'gtk/gtktreeviewcolumn.c')
-rw-r--r--gtk/gtktreeviewcolumn.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 674cb7696b..5817a5f2f8 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -35,6 +35,7 @@
#include "gtktypebuiltins.h"
#include "gtkwidgetprivate.h"
#include "gtkgesturedrag.h"
+#include "gtkeventcontrollerkey.h"
#include "a11y/gtktreeviewaccessibleprivate.h"
@@ -811,6 +812,13 @@ gtk_tree_view_column_cell_layout_get_area (GtkCellLayout *cell_layout)
return priv->cell_area;
}
+static void
+focus_in (GtkEventControllerKey *controller,
+ GtkTreeViewColumn *column)
+{
+ _gtk_tree_view_set_focus_column (GTK_TREE_VIEW (column->priv->tree_view), column);
+}
+
/* Button handling code
*/
static void
@@ -838,6 +846,10 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
gtk_widget_add_controller (priv->button, controller);
+ controller = gtk_event_controller_key_new ();
+ g_signal_connect (controller, "focus-in", G_CALLBACK (focus_in), tree_column);
+ gtk_widget_add_controller (priv->button, controller);
+
priv->frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (priv->frame), GTK_SHADOW_NONE);
gtk_widget_set_hexpand (priv->frame, TRUE);