diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-11-22 21:37:39 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-11-22 21:38:47 -0500 |
commit | 6b95810aaefa73308f2effe43bb53cddac6f117b (patch) | |
tree | bf56c82d41f5f813a960f2c6be8644611cb5022f | |
parent | a7ba57f7515c2efabf401be5727875debc7fca0e (diff) | |
download | gtk+-6b95810aaefa73308f2effe43bb53cddac6f117b.tar.gz |
inspector: Show object title in menu tab
-rw-r--r-- | gtk/inspector/menu.c | 11 | ||||
-rw-r--r-- | gtk/inspector/menu.ui | 10 |
2 files changed, 20 insertions, 1 deletions
diff --git a/gtk/inspector/menu.c b/gtk/inspector/menu.c index 98412d9f2b..7720fe4290 100644 --- a/gtk/inspector/menu.c +++ b/gtk/inspector/menu.c @@ -22,6 +22,8 @@ #include "gtktreestore.h" #include "gtkwidgetprivate.h" +#include "gtklabel.h" + enum { @@ -35,6 +37,7 @@ enum struct _GtkInspectorMenuPrivate { GtkTreeStore *model; + GtkWidget *object_title; }; G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorMenu, gtk_inspector_menu, GTK_TYPE_BOX) @@ -130,6 +133,13 @@ gtk_inspector_menu_set_object (GtkInspectorMenu *sl, if (G_IS_MENU_MODEL (object)) add_menu (sl, G_MENU_MODEL (object), NULL); + + 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 @@ -139,6 +149,7 @@ gtk_inspector_menu_class_init (GtkInspectorMenuClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/menu.ui"); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMenu, model); + gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMenu, object_title); } // vim: set et sw=2 ts=2: diff --git a/gtk/inspector/menu.ui b/gtk/inspector/menu.ui index 07b5be3a0f..2338d95a81 100644 --- a/gtk/inspector/menu.ui +++ b/gtk/inspector/menu.ui @@ -12,12 +12,20 @@ <template class="GtkInspectorMenu" 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> <property name="hscrollbar-policy">automatic</property> <property name="vscrollbar-policy">always</property> - <property name="shadow-type">in</property> <child> <object class= "GtkTreeView"> <property name="visible">True</property> |