From 85380f22f34f28a85b20054e691c5fc1c60f9f09 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 22 Nov 2014 13:41:21 -0500 Subject: [PATCH] inspector: Show object title in the classes tab --- gtk/inspector/classes-list.c | 7 ++++++ gtk/inspector/classes-list.ui | 45 ++++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/gtk/inspector/classes-list.c b/gtk/inspector/classes-list.c index 1fc313082c..04fe934f6f 100644 --- a/gtk/inspector/classes-list.c +++ b/gtk/inspector/classes-list.c @@ -31,6 +31,7 @@ #include "gtkbutton.h" #include "gtkdialog.h" #include "gtkstylecontext.h" +#include "gtklabel.h" enum { @@ -49,6 +50,7 @@ struct _GtkInspectorClassesListPrivate { GtkListStore *model; GtkStyleContext *context; + GtkWidget *object_title; }; G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorClassesList, gtk_inspector_classes_list, GTK_TYPE_BOX) @@ -257,6 +259,7 @@ gtk_inspector_classes_list_set_object (GtkInspectorClassesList *cl, GHashTable *hash_context; GtkTreeIter tree_iter; GtkInspectorClassesListByContext *c; + const gchar *title; cleanup_context (cl); @@ -272,6 +275,9 @@ gtk_inspector_classes_list_set_object (GtkInspectorClassesList *cl, g_object_weak_ref (G_OBJECT (cl->priv->context), gtk_inspector_classes_list_remove_dead_object, cl); + title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title"); + gtk_label_set_label (GTK_LABEL (cl->priv->object_title), title); + hash_context = get_hash_context (cl); if (hash_context) { @@ -313,6 +319,7 @@ gtk_inspector_classes_list_class_init (GtkInspectorClassesListClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/classes-list.ui"); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorClassesList, model); + gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorClassesList, object_title); gtk_widget_class_bind_template_callback (widget_class, add_clicked); gtk_widget_class_bind_template_callback (widget_class, restore_defaults_clicked); gtk_widget_class_bind_template_callback (widget_class, enabled_toggled); diff --git a/gtk/inspector/classes-list.ui b/gtk/inspector/classes-list.ui index 05e08fa941..0414dd4756 100644 --- a/gtk/inspector/classes-list.ui +++ b/gtk/inspector/classes-list.ui @@ -10,23 +10,56 @@