mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 09:00:34 +00:00
inspector: Save some more space
Instead of nesting two notebooks, use a stack switcher in the headerbar for the outer notebook. This saves valuable vertical space.
This commit is contained in:
parent
4222e8d713
commit
6128082f20
@ -27,7 +27,7 @@
|
||||
#include "window.h"
|
||||
#include "widget-tree.h"
|
||||
|
||||
#include "gtknotebook.h"
|
||||
#include "gtkstack.h"
|
||||
#include "gtkmain.h"
|
||||
|
||||
typedef struct
|
||||
@ -213,7 +213,7 @@ select_widget (GtkInspectorWindow *iw,
|
||||
|
||||
iw->selected_widget = widget;
|
||||
|
||||
gtk_notebook_set_current_page (GTK_NOTEBOOK (iw->top_notebook), 0);
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (iw->top_stack), "objects");
|
||||
|
||||
if (!gtk_inspector_widget_tree_find_object (wt, G_OBJECT (widget), &iter))
|
||||
gtk_inspector_widget_tree_scan (wt, gtk_widget_get_toplevel (widget));
|
||||
|
@ -132,16 +132,10 @@ on_send_widget_to_shell_activate (GtkWidget *menuitem,
|
||||
static void
|
||||
gtk_inspector_window_init (GtkInspectorWindow *iw)
|
||||
{
|
||||
gchar *title;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (iw));
|
||||
|
||||
gtk_window_group_add_window (gtk_window_group_new (), GTK_WINDOW (iw));
|
||||
|
||||
title = g_strdup_printf (_("GTK+ Inspector — %s"), g_get_application_name ());
|
||||
gtk_window_set_title (GTK_WINDOW (iw), title);
|
||||
g_free (title);
|
||||
|
||||
if (gtk_inspector_python_is_enabled ())
|
||||
{
|
||||
gtk_widget_show (iw->python_shell);
|
||||
@ -170,7 +164,7 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/window.ui");
|
||||
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, top_notebook);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, top_stack);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_tree);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, prop_list);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list);
|
||||
|
@ -41,7 +41,7 @@ typedef struct
|
||||
{
|
||||
GtkWindow parent;
|
||||
|
||||
GtkWidget *top_notebook;
|
||||
GtkWidget *top_stack;
|
||||
GtkWidget *widget_tree;
|
||||
GtkWidget *prop_list;
|
||||
GtkWidget *child_prop_list;
|
||||
|
@ -42,12 +42,17 @@
|
||||
<property name="pack-type">start</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher">
|
||||
<property name="visible">True</property>
|
||||
<property name="stack">top_stack</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook" id="top_notebook">
|
||||
<object class="GtkStack" id="top_stack">
|
||||
<property name="visible">True</property>
|
||||
<property name="show-border">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
@ -299,77 +304,47 @@
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_expand">True</property>
|
||||
<property name="tab_fill">True</property>
|
||||
<property name="name">objects</property>
|
||||
<property name="title" translatable="yes">Objects</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Objects</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkInspectorResourceList">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_expand">True</property>
|
||||
<property name="tab_fill">True</property>
|
||||
<property name="name">resources</property>
|
||||
<property name="title" translatable="yes">Resources</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Resources</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkInspectorCssEditor">
|
||||
<property name="visible">True</property>
|
||||
<property name="global">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_expand">True</property>
|
||||
<property name="tab_fill">True</property>
|
||||
<property name="name">css</property>
|
||||
<property name="title" translatable="yes">Custom CSS</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Custom CSS</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkInspectorVisual">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_expand">True</property>
|
||||
<property name="tab_fill">True</property>
|
||||
<property name="name">visual</property>
|
||||
<property name="title" translatable="yes">Visual</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Visual</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkInspectorGeneral">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_expand">True</property>
|
||||
<property name="tab_fill">True</property>
|
||||
<property name="name">general</property>
|
||||
<property name="title" translatable="yes">General</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">General</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user