inspector: Show object title on selector tab
This commit is contained in:
@ -24,6 +24,7 @@
|
|||||||
#include "gtktreestore.h"
|
#include "gtktreestore.h"
|
||||||
#include "gtktreeview.h"
|
#include "gtktreeview.h"
|
||||||
#include "gtkwidgetpath.h"
|
#include "gtkwidgetpath.h"
|
||||||
|
#include "gtklabel.h"
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -35,6 +36,7 @@ struct _GtkInspectorSelectorPrivate
|
|||||||
{
|
{
|
||||||
GtkTreeStore *model;
|
GtkTreeStore *model;
|
||||||
GtkTreeView *tree;
|
GtkTreeView *tree;
|
||||||
|
GtkWidget *object_title;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorSelector, gtk_inspector_selector, GTK_TYPE_BOX)
|
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_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, model);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorSelector, tree);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorSelector, tree);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorSelector, object_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -64,6 +67,7 @@ gtk_inspector_selector_set_object (GtkInspectorSelector *oh,
|
|||||||
gint i;
|
gint i;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
gchar *path, **words;
|
gchar *path, **words;
|
||||||
|
const gchar *title;
|
||||||
|
|
||||||
gtk_tree_store_clear (oh->priv->model);
|
gtk_tree_store_clear (oh->priv->model);
|
||||||
|
|
||||||
@ -73,6 +77,9 @@ gtk_inspector_selector_set_object (GtkInspectorSelector *oh,
|
|||||||
return;
|
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);
|
widget = GTK_WIDGET (object);
|
||||||
|
|
||||||
path = gtk_widget_path_to_string (gtk_widget_get_path (widget));
|
path = gtk_widget_path_to_string (gtk_widget_get_path (widget));
|
||||||
|
|||||||
@ -6,7 +6,16 @@
|
|||||||
</columns>
|
</columns>
|
||||||
</object>
|
</object>
|
||||||
<template class="GtkInspectorSelector" parent="GtkBox">
|
<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>
|
<child>
|
||||||
<object class="GtkScrolledWindow">
|
<object class="GtkScrolledWindow">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user