[gtk+] inspector: Cosmetic fixes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Cosmetic fixes
- Date: Sat, 11 Oct 2014 05:00:46 +0000 (UTC)
commit a5846645d18814fd6603f16296e39733c981f863
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Oct 11 00:23:21 2014 -0400
inspector: Cosmetic fixes
Set scrollbars and shadows consistently.
gtk/inspector/actions.ui | 5 +-
gtk/inspector/classes-list.ui | 2 +
gtk/inspector/css-editor.ui | 3 +-
gtk/inspector/misc-info.ui | 2 -
gtk/inspector/object-hierarchy.ui | 2 +
gtk/inspector/object-tree.ui | 6 +--
gtk/inspector/prop-list.ui | 6 +--
gtk/inspector/resource-list.ui | 5 +-
gtk/inspector/signals-list.ui | 5 +-
gtk/inspector/style-prop-list.ui | 6 +--
gtk/inspector/window.c | 29 +++++++++--
gtk/inspector/window.h | 2 +
gtk/inspector/window.ui | 100 +++++++++++++++---------------------
gtk/inspector/window.ui.h | 1 +
14 files changed, 86 insertions(+), 88 deletions(-)
---
diff --git a/gtk/inspector/actions.ui b/gtk/inspector/actions.ui
index 232df4a..11f1f26 100644
--- a/gtk/inspector/actions.ui
+++ b/gtk/inspector/actions.ui
@@ -16,9 +16,8 @@
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="expand">True</property>
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">always</property>
- <property name="shadow-type">in</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<child>
<object class= "GtkTreeView">
<property name="visible">True</property>
diff --git a/gtk/inspector/classes-list.ui b/gtk/inspector/classes-list.ui
index 5ef614a..25a4503 100644
--- a/gtk/inspector/classes-list.ui
+++ b/gtk/inspector/classes-list.ui
@@ -34,6 +34,8 @@
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<property name="expand">True</property>
<child>
<object class="GtkTreeView">
diff --git a/gtk/inspector/css-editor.ui b/gtk/inspector/css-editor.ui
index e6fd0a6..efaa668 100644
--- a/gtk/inspector/css-editor.ui
+++ b/gtk/inspector/css-editor.ui
@@ -43,8 +43,9 @@
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<property name="expand">True</property>
- <property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="view">
<property name="visible">True</property>
diff --git a/gtk/inspector/misc-info.ui b/gtk/inspector/misc-info.ui
index bb03b90..eceb9b5 100644
--- a/gtk/inspector/misc-info.ui
+++ b/gtk/inspector/misc-info.ui
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk30">
<template class="GtkInspectorMiscInfo" parent="GtkScrolledWindow">
-
<child>
<object class="GtkBox">
<property name="visible">true</property>
<property name="orientation">vertical</property>
<property name="margin">60</property>
<property name="spacing">10</property>
-
<child>
<object class="GtkFrame">
<property name="visible">True</property>
diff --git a/gtk/inspector/object-hierarchy.ui b/gtk/inspector/object-hierarchy.ui
index fd5dd0b..e358237 100644
--- a/gtk/inspector/object-hierarchy.ui
+++ b/gtk/inspector/object-hierarchy.ui
@@ -10,6 +10,8 @@
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<property name="expand">True</property>
<child>
<object class="GtkTreeView" id="tree">
diff --git a/gtk/inspector/object-tree.ui b/gtk/inspector/object-tree.ui
index 65f74c9..c4d6032 100644
--- a/gtk/inspector/object-tree.ui
+++ b/gtk/inspector/object-tree.ui
@@ -16,10 +16,8 @@
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">always</property>
- <property name="shadow-type">in</property>
- <property name="width-request">250</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<property name="expand">True</property>
<child>
<object class="GtkTreeView" id="tree">
diff --git a/gtk/inspector/prop-list.ui b/gtk/inspector/prop-list.ui
index a2f25aa..6bfc797 100644
--- a/gtk/inspector/prop-list.ui
+++ b/gtk/inspector/prop-list.ui
@@ -16,10 +16,8 @@
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="expand">True</property>
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">always</property>
- <property name="shadow-type">in</property>
- <property name="width-request">250</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<child>
<object class="GtkTreeView" id="tree">
<property name="visible">True</property>
diff --git a/gtk/inspector/resource-list.ui b/gtk/inspector/resource-list.ui
index e7eefce..299ac1f 100644
--- a/gtk/inspector/resource-list.ui
+++ b/gtk/inspector/resource-list.ui
@@ -21,9 +21,8 @@
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="expand">True</property>
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">always</property>
- <property name="shadow-type">in</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<child>
<object class="GtkTreeView" id="tree">
<property name="visible">True</property>
diff --git a/gtk/inspector/signals-list.ui b/gtk/inspector/signals-list.ui
index e88407f..a8264a8 100644
--- a/gtk/inspector/signals-list.ui
+++ b/gtk/inspector/signals-list.ui
@@ -44,9 +44,8 @@
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="expand">True</property>
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">always</property>
- <property name="shadow-type">in</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<child>
<object class="GtkTreeView" id="view">
<property name="visible">True</property>
diff --git a/gtk/inspector/style-prop-list.ui b/gtk/inspector/style-prop-list.ui
index c004132..bb97e20 100644
--- a/gtk/inspector/style-prop-list.ui
+++ b/gtk/inspector/style-prop-list.ui
@@ -15,10 +15,8 @@
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="expand">True</property>
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">always</property>
- <property name="shadow-type">in</property>
- <property name="width-request">250</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
<child>
<object class="GtkTreeView" id="tree">
<property name="visible">True</property>
diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c
index c6aa52a..d47adfd 100644
--- a/gtk/inspector/window.c
+++ b/gtk/inspector/window.c
@@ -58,15 +58,10 @@ on_object_activated (GtkInspectorObjectTree *wt,
GtkInspectorWindow *iw)
{
const gchar *tab;
- gchar *id;
if (!gtk_inspector_prop_list_set_object (GTK_INSPECTOR_PROP_LIST (iw->prop_list), selected))
return;
- id = g_strconcat (g_type_name_from_instance ((GTypeInstance*)selected), name[0] ? " : " : NULL, name,
NULL);
- gtk_label_set_label (GTK_LABEL (iw->object_id), id);
- g_free (id);
-
gtk_inspector_prop_list_set_object (GTK_INSPECTOR_PROP_LIST (iw->child_prop_list), selected);
gtk_inspector_style_prop_list_set_object (GTK_INSPECTOR_STYLE_PROP_LIST (iw->style_prop_list), selected);
gtk_inspector_signals_list_set_object (GTK_INSPECTOR_SIGNALS_LIST (iw->signals_list), selected);
@@ -103,11 +98,32 @@ close_details (GtkWidget *button, GtkInspectorWindow *iw)
}
static void
+visible_child_name_changed (GObject *obj, GParamSpec *pspec, GtkInspectorWindow *iw)
+{
+ const gchar *child;
+ gboolean objects_visible;
+ gboolean object_details_visible;
+
+ child = gtk_stack_get_visible_child_name (GTK_STACK (iw->top_stack));
+ objects_visible = g_strcmp0 (child, "objects") == 0;
+ child = gtk_stack_get_visible_child_name (GTK_STACK (iw->object_stack));
+ object_details_visible = g_strcmp0 (child, "object-details") == 0;
+
+ gtk_widget_set_visible (iw->select_object, objects_visible);
+ gtk_widget_set_visible (iw->close_details, objects_visible && object_details_visible);
+}
+
+static void
gtk_inspector_window_init (GtkInspectorWindow *iw)
{
gtk_widget_init_template (GTK_WIDGET (iw));
gtk_window_group_add_window (gtk_window_group_new (), GTK_WINDOW (iw));
+
+ g_signal_connect (iw->top_stack, "notify::visible-child-name",
+ G_CALLBACK (visible_child_name_changed), iw);
+ g_signal_connect (iw->object_stack, "notify::visible-child-name",
+ G_CALLBACK (visible_child_name_changed), iw);
}
static void
@@ -134,7 +150,8 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_stack);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_tree);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_details);
- gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_id);
+ gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, close_details);
+ gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, select_object);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, prop_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, signals_list);
diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h
index a0a1a02..7801ee8 100644
--- a/gtk/inspector/window.h
+++ b/gtk/inspector/window.h
@@ -46,6 +46,8 @@ typedef struct
GtkWidget *object_tree;
GtkWidget *object_id;
GtkWidget *object_details;
+ GtkWidget *close_details;
+ GtkWidget *select_object;
GtkWidget *prop_list;
GtkWidget *child_prop_list;
GtkWidget *signals_list;
diff --git a/gtk/inspector/window.ui b/gtk/inspector/window.ui
index 81b9227..07bbec7 100644
--- a/gtk/inspector/window.ui
+++ b/gtk/inspector/window.ui
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk30">
- <object class="GtkImage" id="inspect_image">
- <property name="visible">True</property>
- <property name="icon-name">find-location-symbolic</property>
- <property name="icon-size">4</property>
- </object>
<template class="GtkInspectorWindow" parent="GtkWindow">
<property name="default-height">500</property>
<property name="default-width">1000</property>
@@ -14,17 +9,41 @@
<property name="visible">True</property>
<property name="show-close-button">True</property>
<child>
- <object class="GtkBox">
+ <object class="GtkButton" id="select_object">
<property name="visible">True</property>
+ <property name="tooltip-text" translatable="yes">Select an Object</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <signal name="clicked" handler="gtk_inspector_on_inspect"/>
<style>
- <class name="linked"/>
+ <class name="image-button"/>
</style>
<child>
- <object class="GtkButton">
+ <object class="GtkImage">
<property name="visible">True</property>
- <property name="image">inspect_image</property>
- <property name="tooltip-text" translatable="yes">Select an Object</property>
- <signal name="clicked" handler="gtk_inspector_on_inspect"/>
+ <property name="icon-name">find-location-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack-type">start</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close_details">
+ <property name="tooltip-text" translatable="yes">Show all Objects</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <signal name="clicked" handler="close_details"/>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">view-list-symbolic</property>
+ <property name="icon-size">1</property>
</object>
</child>
</object>
@@ -61,41 +80,6 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <child>
- <object class="GtkButton">
- <property name="visible">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="margin">6</property>
- <signal name="clicked" handler="close_details"/>
- <style>
- <class name="image-button"/>
- </style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">window-close-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="object_id">
- <property name="visible">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- </object>
- <packing>
- <property name="expand">True</property>
- </packing>
- </child>
- </object>
- </child>
- <child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
@@ -112,6 +96,12 @@
</object>
</child>
<child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ </object>
+ </child>
+ <child>
<object class="GtkStack" id="object_details">
<property name="visible">True</property>
<child>
@@ -164,16 +154,14 @@
</packing>
</child>
<child>
- <object class="GtkInspectorClassesList" id="classes_list">
- </object>
+ <object class="GtkInspectorClassesList" id="classes_list"/>
<packing>
<property name="name">css-classes</property>
<property name="title" translatable="yes">CSS Classes</property>
</packing>
</child>
<child>
- <object class="GtkInspectorStylePropList" id="style_prop_list">
- </object>
+ <object class="GtkInspectorStylePropList" id="style_prop_list"/>
<packing>
<property name="name">style-properties</property>
<property name="title" translatable="yes">Style Properties</property>
@@ -189,32 +177,28 @@
</packing>
</child>
<child>
- <object class="GtkInspectorSizeGroups" id="size_groups">
- </object>
+ <object class="GtkInspectorSizeGroups" id="size_groups"/>
<packing>
<property name="name">size-groups</property>
<property name="title" translatable="yes">Size Groups</property>
</packing>
</child>
<child>
- <object class="GtkInspectorDataList" id="data_list">
- </object>
+ <object class="GtkInspectorDataList" id="data_list"/>
<packing>
<property name="name">data</property>
<property name="title" translatable="yes">Data</property>
</packing>
</child>
<child>
- <object class="GtkInspectorActions" id="actions">
- </object>
+ <object class="GtkInspectorActions" id="actions"/>
<packing>
<property name="name">actions</property>
<property name="title" translatable="yes">Actions</property>
</packing>
</child>
<child>
- <object class="GtkInspectorMenu" id="menu">
- </object>
+ <object class="GtkInspectorMenu" id="menu"/>
<packing>
<property name="name">menu</property>
<property name="title" translatable="yes">Menu</property>
diff --git a/gtk/inspector/window.ui.h b/gtk/inspector/window.ui.h
index 88188ac..57143ed 100644
--- a/gtk/inspector/window.ui.h
+++ b/gtk/inspector/window.ui.h
@@ -1,4 +1,5 @@
N_("Select an Object");
+N_("Show all Objects");
N_("Miscellaneous");
N_("Properties");
N_("Signals");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]