inspector: Show object title in the misc tab

This commit is contained in:
Matthias Clasen 2014-11-22 09:53:40 -05:00
parent 5b7233f136
commit 2ea3171ff9
2 changed files with 19 additions and 1 deletions

View File

@ -70,6 +70,7 @@ struct _GtkInspectorMiscInfoPrivate {
GtkWidget *is_toplevel;
GtkWidget *child_visible_row;
GtkWidget *child_visible;
GtkWidget *object_title;
guint update_source_id;
gint64 last_frame;
@ -372,6 +373,8 @@ void
gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
GObject *object)
{
const gchar *title;
if (sl->priv->object)
{
g_signal_handlers_disconnect_by_func (sl->priv->object, state_flags_changed, sl);
@ -388,6 +391,9 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
g_object_weak_ref (G_OBJECT (sl), disconnect_each_other, object);
g_object_weak_ref (object, disconnect_each_other, sl);
title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title");
gtk_label_set_label (GTK_LABEL (sl->priv->object_title), title);
if (GTK_IS_WIDGET (object))
{
gtk_widget_show (sl->priv->refcount_row);
@ -577,6 +583,7 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, is_toplevel);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, child_visible_row);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, child_visible);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, object_title);
gtk_widget_class_bind_template_callback (widget_class, show_default_widget);
gtk_widget_class_bind_template_callback (widget_class, show_focus_widget);

View File

@ -5,8 +5,19 @@
<object class="GtkBox">
<property name="visible">true</property>
<property name="orientation">vertical</property>
<property name="margin">60</property>
<property name="margin-start">60</property>
<property name="margin-end">60</property>
<property name="margin-bottom">60</property>
<property name="spacing">10</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">30</property>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="visible">True</property>