[gtk/antoniof-main-patch-03677: 2/2] columnview: Forward all focus to internal listview
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/antoniof-main-patch-03677: 2/2] columnview: Forward all focus to internal listview
- Date: Mon, 3 Oct 2022 19:26:45 +0000 (UTC)
commit 05caa266dec3073def01c2d9ace6c9f6cf500331
Author: António Fernandes <antoniof gnome org>
Date: Sat Sep 10 22:43:57 2022 +0000
columnview: Forward all focus to internal listview
For the same reasoning as the preceding commit.
The header could not be focused anyway.
gtk/gtkcolumnview.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c
index 1e7299ed47..06ea24b377 100644
--- a/gtk/gtkcolumnview.c
+++ b/gtk/gtkcolumnview.c
@@ -269,6 +269,23 @@ G_DEFINE_TYPE_WITH_CODE (GtkColumnView, gtk_column_view, GTK_TYPE_WIDGET,
static GParamSpec *properties[N_PROPS] = { NULL, };
static guint signals[LAST_SIGNAL] = { 0 };
+static gboolean
+gtk_column_view_focus (GtkWidget *widget,
+ GtkDirectionType direction)
+{
+ GtkColumnView *self = GTK_COLUMN_VIEW (widget);
+
+ return gtk_widget_child_focus (GTK_WIDGET (self->listview), direction);
+}
+
+static gboolean
+gtk_column_view_grab_focus (GtkWidget *widget)
+{
+ GtkColumnView *self = GTK_COLUMN_VIEW (widget);
+
+ return gtk_widget_grab_focus (GTK_WIDGET (self->listview));
+}
+
static void
gtk_column_view_measure (GtkWidget *widget,
GtkOrientation orientation,
@@ -659,6 +676,8 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gpointer iface;
+ widget_class->focus = gtk_column_view_focus;
+ widget_class->grab_focus = gtk_column_view_grab_focus;
widget_class->measure = gtk_column_view_measure;
widget_class->size_allocate = gtk_column_view_allocate;
@@ -1314,7 +1333,6 @@ gtk_column_view_init (GtkColumnView *self)
g_quark_from_static_string (I_("view")));
gtk_widget_set_overflow (GTK_WIDGET (self), GTK_OVERFLOW_HIDDEN);
- gtk_widget_set_focusable (GTK_WIDGET (self), TRUE);
self->reorderable = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]