forked from AuroraMiddleware/gtk
inspector: Show object title in the classes tab
This commit is contained in:
parent
fe5f9c560b
commit
85380f22f3
@ -31,6 +31,7 @@
|
||||
#include "gtkbutton.h"
|
||||
#include "gtkdialog.h"
|
||||
#include "gtkstylecontext.h"
|
||||
#include "gtklabel.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -49,6 +50,7 @@ struct _GtkInspectorClassesListPrivate
|
||||
{
|
||||
GtkListStore *model;
|
||||
GtkStyleContext *context;
|
||||
GtkWidget *object_title;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorClassesList, gtk_inspector_classes_list, GTK_TYPE_BOX)
|
||||
@ -257,6 +259,7 @@ gtk_inspector_classes_list_set_object (GtkInspectorClassesList *cl,
|
||||
GHashTable *hash_context;
|
||||
GtkTreeIter tree_iter;
|
||||
GtkInspectorClassesListByContext *c;
|
||||
const gchar *title;
|
||||
|
||||
cleanup_context (cl);
|
||||
|
||||
@ -272,6 +275,9 @@ gtk_inspector_classes_list_set_object (GtkInspectorClassesList *cl,
|
||||
|
||||
g_object_weak_ref (G_OBJECT (cl->priv->context), gtk_inspector_classes_list_remove_dead_object, cl);
|
||||
|
||||
title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title");
|
||||
gtk_label_set_label (GTK_LABEL (cl->priv->object_title), title);
|
||||
|
||||
hash_context = get_hash_context (cl);
|
||||
if (hash_context)
|
||||
{
|
||||
@ -313,6 +319,7 @@ gtk_inspector_classes_list_class_init (GtkInspectorClassesListClass *klass)
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/classes-list.ui");
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorClassesList, model);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorClassesList, object_title);
|
||||
gtk_widget_class_bind_template_callback (widget_class, add_clicked);
|
||||
gtk_widget_class_bind_template_callback (widget_class, restore_defaults_clicked);
|
||||
gtk_widget_class_bind_template_callback (widget_class, enabled_toggled);
|
||||
|
@ -10,23 +10,56 @@
|
||||
<template class="GtkInspectorClassesList" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">small-toolbar</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="margin">6</property>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="tooltip-text" translatable="yes">Add a class</property>
|
||||
<signal name="clicked" handler="add_clicked"/>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">start</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">edit-undo-symbolic</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="tooltip-text" translatable="yes">Restore defaults for this widget</property>
|
||||
<signal name="clicked" handler="restore_defaults_clicked"/>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">edit-undo-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">start</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="center">
|
||||
<object class="GtkLabel" id="object_title">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
Loading…
Reference in New Issue
Block a user