[gtk+] inspector: Show object title in hierarchy tab
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Show object title in hierarchy tab
- Date: Sun, 23 Nov 2014 03:26:00 +0000 (UTC)
commit d2aad065130e5ab389c45ef030ab3b80691ce056
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 22 13:54:16 2014 -0500
inspector: Show object title in hierarchy tab
gtk/inspector/object-hierarchy.c | 9 ++++++++-
gtk/inspector/object-hierarchy.ui | 11 ++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/object-hierarchy.c b/gtk/inspector/object-hierarchy.c
index 27071b4..fd26981 100644
--- a/gtk/inspector/object-hierarchy.c
+++ b/gtk/inspector/object-hierarchy.c
@@ -28,6 +28,7 @@
#include "gtktreeselection.h"
#include "gtktreestore.h"
#include "gtktreeview.h"
+#include "gtklabel.h"
enum
@@ -39,6 +40,7 @@ struct _GtkInspectorObjectHierarchyPrivate
{
GtkTreeStore *model;
GtkTreeView *tree;
+ GtkWidget *object_title;
};
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorObjectHierarchy, gtk_inspector_object_hierarchy, GTK_TYPE_BOX)
@@ -58,6 +60,7 @@ gtk_inspector_object_hierarchy_class_init (GtkInspectorObjectHierarchyClass *kla
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/object-hierarchy.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorObjectHierarchy, model);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorObjectHierarchy, tree);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorObjectHierarchy, object_title);
}
void
@@ -72,6 +75,7 @@ gtk_inspector_object_hierarchy_set_object (GtkInspectorObjectHierarchy *oh,
GHashTableIter hit;
GType *ifaces;
gint i;
+ const gchar *title;
gtk_tree_store_clear (oh->priv->model);
@@ -80,7 +84,10 @@ gtk_inspector_object_hierarchy_set_object (GtkInspectorObjectHierarchy *oh,
interfaces = g_hash_table_new (g_str_hash, g_str_equal);
type = ((GTypeInstance*)object)->g_class->g_type;
-
+
+ title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title");
+ gtk_label_set_label (GTK_LABEL (oh->priv->object_title), title);
+
do
{
class_name = g_type_name (type);
diff --git a/gtk/inspector/object-hierarchy.ui b/gtk/inspector/object-hierarchy.ui
index 2b25cf7..d8a99cc 100644
--- a/gtk/inspector/object-hierarchy.ui
+++ b/gtk/inspector/object-hierarchy.ui
@@ -6,7 +6,16 @@
</columns>
</object>
<template class="GtkInspectorObjectHierarchy" parent="GtkBox">
- <property name="orientation">horizontal</property>
+ <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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]