[nautilus/wip/toolbar-start-end: 3/4] toolbar: Wrap toolbar children in a GtkBox




commit 4ee25f09f7d27f7a7eab01a1b60823ae8deb4a52
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 | 113 +++++++++++++++++++----------------
 1 file changed, 61 insertions(+), 52 deletions(-)
---
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index d7f8f4ecb..c43f0fb08 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -118,65 +118,74 @@
           </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="NautilusHistoryControls">
-                <property name="window-slot" bind-source="NautilusToolbar" bind-property="window-slot" 
bind-flags="sync-create"/>
+          <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="NautilusHistoryControls">
+                    <property name="window-slot" bind-source="NautilusToolbar" bind-property="window-slot" 
bind-flags="sync-create"/>
                   </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="NautilusToolbarEnd">
-                <property name="window-slot" bind-source="NautilusToolbar" bind-property="window-slot" 
bind-flags="sync-create"/>
+          <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="NautilusToolbarEnd">
+                    <property name="margin-end">6</property>
+                    <property name="window-slot" bind-source="NautilusToolbar" bind-property="window-slot" 
bind-flags="sync-create"/>
+                  </object>
+                </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>
+                </property>
               </object>
-            </property>
+            </child>
           </object>
         </child>
       </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]