[gtk+] inspector: Show object title in size groups tab
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Show object title in size groups tab
- Date: Sun, 23 Nov 2014 03:26:26 +0000 (UTC)
commit 0a37493384d126ba1826282b8ead97fdd0adc681
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 22 20:56:49 2014 -0500
inspector: Show object title in size groups tab
gtk/inspector/size-groups.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/size-groups.c b/gtk/inspector/size-groups.c
index 48e19d2..860f398 100644
--- a/gtk/inspector/size-groups.c
+++ b/gtk/inspector/size-groups.c
@@ -215,6 +215,7 @@ add_size_group (GtkInspectorSizeGroups *sl,
frame = gtk_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (sl), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_style_context_add_class (gtk_widget_get_style_context (box), GTK_STYLE_CLASS_VIEW);
gtk_container_add (GTK_CONTAINER (frame), box);
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
@@ -273,6 +274,8 @@ gtk_inspector_size_groups_set_object (GtkInspectorSizeGroups *sl,
GObject *object)
{
GSList *groups, *l;
+ const gchar *title;
+ GtkWidget *label;
clear_view (sl);
@@ -282,6 +285,16 @@ gtk_inspector_size_groups_set_object (GtkInspectorSizeGroups *sl,
return;
}
+ title = (const gchar *)g_object_get_data (object, "gtk-inspector-object-title");
+ label = gtk_label_new (title);
+
+ gtk_widget_set_halign (label, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+ gtk_widget_set_margin_top (label, 12);
+ gtk_widget_set_margin_bottom (label, 30);
+ gtk_widget_show (label);
+ gtk_container_add (GTK_CONTAINER (sl), label);
+
groups = _gtk_widget_get_sizegroups (GTK_WIDGET (object));
if (groups)
gtk_widget_show (GTK_WIDGET (sl));
@@ -297,8 +310,10 @@ gtk_inspector_size_groups_init (GtkInspectorSizeGroups *sl)
{
g_object_set (sl,
"orientation", GTK_ORIENTATION_VERTICAL,
- "margin", 40,
- "spacing", 20,
+ "margin-start", 60,
+ "margin-end", 60,
+ "margin-bottom", 60,
+ "spacing", 10,
NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]