[gnome-software: 8/18] gs-shell: Rearrange headerbars




commit df225847e1601358d39cb2612fe95ea06488648b
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Jan 28 19:32:19 2021 +0000

    gs-shell: Rearrange headerbars
    
    When switching between small and large views of the main window
    (adaptive sizing), we now use the main headerbar in the small view,
    rather than the side headerbar.
    
    This makes the transition animations clearer, and simplifies some
    visibility property bindings.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1111

 src/gs-shell.ui | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 61 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-shell.ui b/src/gs-shell.ui
index d17d0c603..a36bfa4f9 100644
--- a/src/gs-shell.ui
+++ b/src/gs-shell.ui
@@ -51,24 +51,24 @@
             <property name="visible">True</property>
             <property name="can-focus">False</property>
             <property name="orientation">horizontal</property>
-            <property name="visible-child">sidebar_header</property>
+            <property name="visible-child">main_header</property>
             <property name="mode-transition-duration" bind-source="main_leaflet" 
bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
             <property name="child-transition-duration" bind-source="main_leaflet" 
bind-property="child-transition-duration" bind-flags="bidirectional|sync-create"/>
             <property name="transition-type" bind-source="main_leaflet" bind-property="transition-type" 
bind-flags="bidirectional|sync-create"/>
             <child>
               <object class="GtkHeaderBar" id="sidebar_header">
-                <property name="visible">True</property>
+                <property name="visible" bind-source="sidebar_box" bind-property="visible" 
bind-flags="sync-create|bidirectional" />
                 <property name="can-focus">False</property>
                 <property name="show-close-button">True</property>
                 <property name="title" translatable="yes">Software</property>
                 <child>
-                  <object class="GtkToggleButton" id="search_button">
+                  <object class="GtkToggleButton" id="search_button_sidebar">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="active" bind-source="search_bar" bind-property="search-mode-enabled" 
bind-flags="sync-create|bidirectional" />
                     <signal name="clicked" handler="search_button_clicked_cb"/>
                     <child internal-child="accessible">
-                      <object class="AtkObject" id="search_button_accessible">
+                      <object class="AtkObject" id="search_button_accessible_sidebar">
                         <property name="accessible-name" translatable="yes">Search</property>
                       </object>
                     </child>
@@ -76,7 +76,7 @@
                       <class name="image-button"/>
                     </style>
                     <child>
-                      <object class="GtkImage" id="search_image">
+                      <object class="GtkImage" id="search_image_sidebar">
                         <property name="visible">True</property>
                         <property name="icon_name">edit-find-symbolic</property>
                         <property name="icon_size">1</property>
@@ -91,7 +91,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkMenuButton" id="menu_button">
+                  <object class="GtkMenuButton" id="menu_button_sidebar">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="sensitive">True</property>
@@ -168,6 +168,35 @@
                     </child>
                   </object>
                 </child>
+                <child>
+                  <object class="GtkToggleButton" id="search_button">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="active" bind-source="search_bar" bind-property="search-mode-enabled" 
bind-flags="sync-create|bidirectional" />
+                    <signal name="clicked" handler="search_button_clicked_cb"/>
+                    <child internal-child="accessible">
+                      <object class="AtkObject" id="search_button_accessible">
+                        <property name="accessible-name" translatable="yes">Search</property>
+                      </object>
+                    </child>
+                    <style>
+                      <class name="image-button"/>
+                    </style>
+                    <child>
+                      <object class="GtkImage" id="search_image">
+                        <property name="visible">True</property>
+                        <property name="icon_name">edit-find-symbolic</property>
+                        <property name="icon_size">1</property>
+                      </object>
+                    </child>
+                    <style>
+                      <class name="image-button"/>
+                    </style>
+                  </object>
+                  <packing>
+                    <property name="pack-type">start</property>
+                  </packing>
+                </child>
                 <child type="title">
                   <object class="GtkLabel" id="application_details_header">
                     <property name="visible">True</property>
@@ -178,6 +207,32 @@
                     </style>
                   </object>
                 </child>
+                <child>
+                  <object class="GtkMenuButton" id="menu_button">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="sensitive">True</property>
+                    <property name="menu_model">primary_menu</property>
+                    <child internal-child="accessible">
+                      <object class="AtkObject">
+                        <property name="accessible-name" translatable="yes">Primary Menu</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkImage">
+                        <property name="visible">True</property>
+                        <property name="icon_name">open-menu-symbolic</property>
+                        <property name="icon_size">1</property>
+                      </object>
+                    </child>
+                    <style>
+                      <class name="image-button"/>
+                    </style>
+                  </object>
+                  <packing>
+                    <property name="pack-type">end</property>
+                  </packing>
+                </child>
                 <child>
                   <object class="GtkMenuButton" id="header_selection_menu_button">
                     <property name="visible">False</property>


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