inspector: Show object title on selector tab
This commit is contained in:
@ -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));
|
||||
|
||||
Reference in New Issue
Block a user