[gtk+] inspector: Show object title in the misc tab
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Show object title in the misc tab
- Date: Sun, 23 Nov 2014 03:25:29 +0000 (UTC)
commit 2ea3171ff97609c8f6409136ffee9ac1e153ba5b
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 22 09:53:40 2014 -0500
inspector: Show object title in the misc tab
gtk/inspector/misc-info.c | 7 +++++++
gtk/inspector/misc-info.ui | 13 ++++++++++++-
2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/gtk/inspector/misc-info.c b/gtk/inspector/misc-info.c
index 69c834c..2ba9388 100644
--- a/gtk/inspector/misc-info.c
+++ b/gtk/inspector/misc-info.c
@@ -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);
diff --git a/gtk/inspector/misc-info.ui b/gtk/inspector/misc-info.ui
index d0a7966..c8c75bc 100644
--- a/gtk/inspector/misc-info.ui
+++ b/gtk/inspector/misc-info.ui
@@ -5,9 +5,20 @@
<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>
<property name="halign">center</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]