[gtk+] inspector: Show object title in actions tab



commit 38c3600d8bd0d93447058b9663a1d269a8f4840a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Nov 22 15:40:24 2014 -0500

    inspector: Show object title in actions tab

 gtk/inspector/actions.c  |   10 ++++++++++
 gtk/inspector/actions.ui |    9 +++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/actions.c b/gtk/inspector/actions.c
index dc7a687..aafbaec 100644
--- a/gtk/inspector/actions.c
+++ b/gtk/inspector/actions.c
@@ -27,6 +27,7 @@
 #include "gtkliststore.h"
 #include "gtkwidgetprivate.h"
 #include "gtkpopover.h"
+#include "gtklabel.h"
 
 enum
 {
@@ -43,6 +44,7 @@ struct _GtkInspectorActionsPrivate
   GtkListStore *model;
   GHashTable *groups;
   GHashTable *iters;
+  GtkWidget *object_title;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorActions, gtk_inspector_actions, GTK_TYPE_BOX)
@@ -229,6 +231,13 @@ gtk_inspector_actions_set_object (GtkInspectorActions *sl,
           g_free (prefixes);
         }
     }
+
+  if (G_IS_OBJECT (object))
+    {
+      const gchar *title;
+      title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title");
+      gtk_label_set_label (GTK_LABEL (sl->priv->object_title), title);
+    }
 }
 
 static void
@@ -277,6 +286,7 @@ gtk_inspector_actions_class_init (GtkInspectorActionsClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/actions.ui");
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorActions, model);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorActions, object_title);
   gtk_widget_class_bind_template_callback (widget_class, row_activated);
 }
 
diff --git a/gtk/inspector/actions.ui b/gtk/inspector/actions.ui
index c87a06b..471a436 100644
--- a/gtk/inspector/actions.ui
+++ b/gtk/inspector/actions.ui
@@ -13,6 +13,15 @@
   <template class="GtkInspectorActions" parent="GtkBox">
     <property name="orientation">vertical</property>
     <child>
+      <object class="GtkLabel" id="object_title">
+        <property name="visible">True</property>
+        <property name="halign">fill</property>
+        <property name="valign">center</property>
+        <property name="margin-top">12</property>
+        <property name="margin-bottom">12</property>
+      </object>
+    </child>
+    <child>
       <object class="GtkScrolledWindow">
         <property name="visible">True</property>
         <property name="expand">True</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]