summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-11-22 16:21:17 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-11-22 21:38:47 -0500
commitf38081a4a54ed30f0a7cf44f1864ee33c7fa2b25 (patch)
tree4d5bb3f2494266e3a4076f8d015d21ecca1c5046
parent38c3600d8bd0d93447058b9663a1d269a8f4840a (diff)
downloadgtk+-f38081a4a54ed30f0a7cf44f1864ee33c7fa2b25.tar.gz
inspector: Show object title on selector tab
-rw-r--r--gtk/inspector/selector.c7
-rw-r--r--gtk/inspector/selector.ui11
2 files changed, 17 insertions, 1 deletions
diff --git a/gtk/inspector/selector.c b/gtk/inspector/selector.c
index cfaed2feab..ce8c763176 100644
--- a/gtk/inspector/selector.c
+++ b/gtk/inspector/selector.c
@@ -24,6 +24,7 @@
#include "gtktreestore.h"
#include "gtktreeview.h"
#include "gtkwidgetpath.h"
+#include "gtklabel.h"
enum
@@ -35,6 +36,7 @@ struct _GtkInspectorSelectorPrivate
{
GtkTreeStore *model;
GtkTreeView *tree;
+ GtkWidget *object_title;
};
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorSelector, gtk_inspector_selector, GTK_TYPE_BOX)
@@ -54,6 +56,7 @@ gtk_inspector_selector_class_init (GtkInspectorSelectorClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/selector.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorSelector, model);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorSelector, tree);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorSelector, object_title);
}
void
@@ -64,6 +67,7 @@ gtk_inspector_selector_set_object (GtkInspectorSelector *oh,
gint i;
GtkWidget *widget;
gchar *path, **words;
+ const gchar *title;
gtk_tree_store_clear (oh->priv->model);
@@ -73,6 +77,9 @@ gtk_inspector_selector_set_object (GtkInspectorSelector *oh,
return;
}
+ title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title");
+ gtk_label_set_label (GTK_LABEL (oh->priv->object_title), title);
+
widget = GTK_WIDGET (object);
path = gtk_widget_path_to_string (gtk_widget_get_path (widget));
diff --git a/gtk/inspector/selector.ui b/gtk/inspector/selector.ui
index 5f6d6ae2e4..19f89280b5 100644
--- a/gtk/inspector/selector.ui
+++ b/gtk/inspector/selector.ui
@@ -6,7 +6,16 @@
</columns>
</object>
<template class="GtkInspectorSelector" 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>