From e23baa59f02fb042bf08f09076427c7e9439b61f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 17 Dec 2019 23:51:11 -0500 Subject: [PATCH] inspector: Add columns to the object tree Add columnview columns in the object tree. We do the same for treeview columns. --- gtk/inspector/object-tree.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c index 6bf5961db4..60d96081f4 100644 --- a/gtk/inspector/object-tree.c +++ b/gtk/inspector/object-tree.c @@ -336,6 +336,29 @@ object_tree_tree_view_get_children (GObject *object) return G_LIST_MODEL (result); } +static GListModel * +object_tree_column_view_get_children (GObject *object) +{ + GtkColumnView *view = GTK_COLUMN_VIEW (object); + GListStore *result_list; + GtkFlattenListModel *result; + GListModel *columns, *sublist; + + result_list = g_list_store_new (G_TYPE_LIST_MODEL); + + columns = gtk_column_view_get_columns (view); + g_list_store_append (result_list, columns); + + sublist = object_tree_widget_get_children (object); + g_list_store_append (result_list, sublist); + g_object_unref (sublist); + + result = gtk_flatten_list_model_new (G_TYPE_OBJECT, G_LIST_MODEL (result_list)); + g_object_unref (result_list); + + return G_LIST_MODEL (result); +} + static GListModel * object_tree_icon_view_get_children (GObject *object) { @@ -499,6 +522,11 @@ static const ObjectTreeClassFuncs object_tree_class_funcs[] = { object_tree_widget_get_parent, object_tree_tree_view_get_children }, + { + gtk_column_view_get_type, + object_tree_widget_get_parent, + object_tree_column_view_get_children + }, { gtk_combo_box_get_type, object_tree_widget_get_parent,