inspector: Show object title in actions tab
This commit is contained in:
@ -27,6 +27,7 @@
|
|||||||
#include "gtkliststore.h"
|
#include "gtkliststore.h"
|
||||||
#include "gtkwidgetprivate.h"
|
#include "gtkwidgetprivate.h"
|
||||||
#include "gtkpopover.h"
|
#include "gtkpopover.h"
|
||||||
|
#include "gtklabel.h"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -43,6 +44,7 @@ struct _GtkInspectorActionsPrivate
|
|||||||
GtkListStore *model;
|
GtkListStore *model;
|
||||||
GHashTable *groups;
|
GHashTable *groups;
|
||||||
GHashTable *iters;
|
GHashTable *iters;
|
||||||
|
GtkWidget *object_title;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorActions, gtk_inspector_actions, GTK_TYPE_BOX)
|
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorActions, gtk_inspector_actions, GTK_TYPE_BOX)
|
||||||
@ -229,6 +231,13 @@ gtk_inspector_actions_set_object (GtkInspectorActions *sl,
|
|||||||
g_free (prefixes);
|
g_free (prefixes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (G_IS_OBJECT (object))
|
||||||
|
{
|
||||||
|
const gchar *title;
|
||||||
|
title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title");
|
||||||
|
gtk_label_set_label (GTK_LABEL (sl->priv->object_title), title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -277,6 +286,7 @@ gtk_inspector_actions_class_init (GtkInspectorActionsClass *klass)
|
|||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/actions.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/actions.ui");
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorActions, model);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorActions, model);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorActions, object_title);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, row_activated);
|
gtk_widget_class_bind_template_callback (widget_class, row_activated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,15 @@
|
|||||||
</object>
|
</object>
|
||||||
<template class="GtkInspectorActions" parent="GtkBox">
|
<template class="GtkInspectorActions" parent="GtkBox">
|
||||||
<property name="orientation">vertical</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