[nautilus/wip/toolbar-start-end: 7/8] toolbar: Wrap toolbar children in a GtkBox
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/toolbar-start-end: 7/8] toolbar: Wrap toolbar children in a GtkBox
- Date: Sat, 6 Aug 2022 23:55:32 +0000 (UTC)
commit a8eb74c20cd66e940dc109809dacb84cb6d5664d
Author: Christopher Davis <christopherdavis gnome org>
Date: Fri Jul 29 23:39:12 2022 -0400
toolbar: Wrap toolbar children in a GtkBox
GtkHeaderBar automatically provides spacing for its children.
However, this spacing doesn't play well with hidden revealers.
In order to not have double spacing, this commit creates GtkBoxes
at both ends of the toolbar, and moves the margins to the children.
src/resources/ui/nautilus-toolbar.ui | 163 ++++++++++++++++++-----------------
1 file changed, 86 insertions(+), 77 deletions(-)
---
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index 1a7fcf4ed..b5f150f08 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -118,92 +118,101 @@
</object>
</child>
<child type="start">
- <object class="GtkToggleButton" id="show_sidebar_button">
- <property name="visible" bind-source="NautilusToolbar" bind-property="show-sidebar-button"
bind-flags="bidirectional|sync-create"/>
- <property name="active" bind-source="NautilusToolbar" bind-property="sidebar-button-active"
bind-flags="bidirectional|sync-create"/>
- <property name="tooltip-text" translatable="yes">Show sidebar</property>
- <property name="icon-name">sidebar-show-symbolic</property>
- </object>
- </child>
- <child type="start">
- <object class="GtkRevealer">
- <property name="reveal-child" bind-source="NautilusToolbar"
bind-property="show-toolbar-children" bind-flags="sync-create"/>
- <property name="transition-type">slide-right</property>
- <property name="child">
- <object class="GtkBox">
- <property name="spacing">6</property>
- <child>
- <object class="NautilusHistoryControls">
- <property name="window-slot" bind-source="NautilusToolbar" bind-property="window-slot"
bind-flags="sync-create"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <style>
- <class name="spacer"/>
- </style>
- </object>
- </child>
+ <object class="GtkBox">
+ <child>
+ <object class="GtkToggleButton" id="show_sidebar_button">
+ <property name="visible" bind-source="NautilusToolbar" bind-property="show-sidebar-button"
bind-flags="bidirectional|sync-create"/>
+ <property name="active" bind-source="NautilusToolbar" bind-property="sidebar-button-active"
bind-flags="bidirectional|sync-create"/>
+ <property name="tooltip-text" translatable="yes">Show sidebar</property>
+ <property name="icon-name">sidebar-show-symbolic</property>
</object>
- </property>
- </object>
- </child>
- <child type="end">
- <object class="GtkMenuButton" id="app_button">
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="icon_name">open-menu-symbolic</property>
- <property name="popover">
- <object class="GtkPopoverMenu">
- <property name="menu-model">app_menu</property>
- <child type="zoom-out">
- <object class="GtkButton">
- <property name="icon-name">zoom-out-symbolic</property>
- <property name="action-name">view.zoom-out</property>
- <property name="tooltip-text">Zoom out</property>
- <style>
- <class name="flat"/>
- </style>
- </object>
- </child>
- <child type="zoom-in">
- <object class="GtkButton">
- <property name="icon-name">zoom-in-symbolic</property>
- <property name="action-name">view.zoom-in</property>
- <property name="tooltip-text">Zoom in</property>
- <style>
- <class name="flat"/>
- </style>
+ </child>
+ <child>
+ <object class="GtkRevealer">
+ <property name="reveal-child" bind-source="NautilusToolbar"
bind-property="show-toolbar-children" bind-flags="sync-create"/>
+ <property name="transition-type">slide-right</property>
+ <property name="child">
+ <object class="GtkBox">
+ <property name="spacing">6</property>
+ <child>
+ <object class="NautilusHistoryControls">
+ <property name="window-slot" bind-source="NautilusToolbar"
bind-property="window-slot" bind-flags="sync-create"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <style>
+ <class name="spacer"/>
+ </style>
+ </object>
+ </child>
</object>
- </child>
+ </property>
</object>
- </property>
+ </child>
</object>
</child>
<child type="end">
- <object class="GtkRevealer">
- <property name="reveal-child" bind-source="NautilusToolbar"
bind-property="show-toolbar-children" bind-flags="sync-create"/>
- <property name="transition-type">slide-left</property>
- <property name="child">
- <object class="GtkBox">
- <property name="spacing">6</property>
- <child>
- <object class="GtkSeparator">
- <style>
- <class name="spacer"/>
- </style>
+ <object class="GtkBox">
+ <child>
+ <object class="GtkRevealer">
+ <property name="reveal-child" bind-source="NautilusToolbar"
bind-property="show-toolbar-children" bind-flags="sync-create"/>
+ <property name="transition-type">slide-left</property>
+ <property name="child">
+ <object class="GtkBox">
+ <property name="spacing">6</property>
+ <property name="margin-end">6</property>
+ <child>
+ <object class="GtkSeparator">
+ <style>
+ <class name="spacer"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="NautilusProgressIndicator"/>
+ </child>
+ <child>
+ <object class="NautilusViewControls">
+ <property name="window-slot" bind-source="NautilusToolbar"
bind-property="window-slot" bind-flags="sync-create"/>
+ </object>
+ </child>
</object>
- </child>
- <child>
- <object class="NautilusProgressIndicator"/>
- </child>
- <child>
- <object class="NautilusViewControls">
- <property name="window-slot" bind-source="NautilusToolbar" bind-property="window-slot"
bind-flags="sync-create"/>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuButton" id="app_button">
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="icon_name">open-menu-symbolic</property>
+ <property name="popover">
+ <object class="GtkPopoverMenu">
+ <property name="menu-model">app_menu</property>
+ <child type="zoom-out">
+ <object class="GtkButton">
+ <property name="icon-name">zoom-out-symbolic</property>
+ <property name="action-name">view.zoom-out</property>
+ <property name="tooltip-text">Zoom out</property>
+ <style>
+ <class name="flat"/>
+ </style>
+ </object>
+ </child>
+ <child type="zoom-in">
+ <object class="GtkButton">
+ <property name="icon-name">zoom-in-symbolic</property>
+ <property name="action-name">view.zoom-in</property>
+ <property name="tooltip-text">Zoom in</property>
+ <style>
+ <class name="flat"/>
+ </style>
+ </object>
+ </child>
</object>
- </child>
+ </property>
</object>
- </property>
+ </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]