[gnome-software: 6/10] shell: Merge the title and content areas




commit 7aeb8e641e6f1b3a8b00a56fffd60fcbc4b74040
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Jun 21 09:28:43 2021 +0200

    shell: Merge the title and content areas
    
    This moves the headerbars with their content area, dropping the
    header-specific decks and simplifying the code and the layout.
    
    This purposefully leaves the indentation broken to ease review, it will
    be fixed in a later commit.

 src/gs-shell.ui | 354 ++++++++++++++++++++++++++------------------------------
 1 file changed, 164 insertions(+), 190 deletions(-)
---
diff --git a/src/gs-shell.ui b/src/gs-shell.ui
index e72db9d72..9269e4817 100644
--- a/src/gs-shell.ui
+++ b/src/gs-shell.ui
@@ -32,172 +32,6 @@
         <property name="visible">True</property>
         <property name="transition-type">crossfade</property>
         <signal name="notify::visible-child" handler="stack_notify_visible_child_cb"/>
-        <child>
-          <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="HdyDeck" id="details_header_deck">
-                <property name="visible">True</property>
-                <child>
-                  <object class="HdyDeck" id="header_deck">
-                    <property name="visible">True</property>
-                        <child>
-                          <object class="HdyHeaderBar" id="main_header">
-                            <property name="visible">True</property>
-                            <property name="can-focus">False</property>
-                            <property name="hexpand">True</property>
-                            <property name="show-close-button">True</property>
-                            <property name="centering-policy">strict</property>
-                            <child>
-                              <object class="GtkToggleButton" id="search_button_main">
-                                <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">
-                                    <property name="accessible-name" translatable="yes">Search</property>
-                                  </object>
-                                </child>
-                                <style>
-                                  <class name="image-button"/>
-                                </style>
-                                <child>
-                                  <object class="GtkImage">
-                                    <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>
-                              <object class="GtkMenuButton" id="menu_button_main">
-                                <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 type="title">
-                              <object class="HdyViewSwitcherTitle" id="title_switcher">
-                                <property name="visible">True</property>
-                                <property name="stack">stack_main</property>
-                                <property name="title" bind-source="GsShell" bind-property="title" 
bind-flags="sync-create"/>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                    <child>
-                      <object class="HdyHeaderBar" id="sub_header">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="show-close-button">True</property>
-                        <child>
-                          <object class="GtkButton" id="button_back">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <signal name="clicked" handler="gs_shell_back_button_cb"/>
-                            <child internal-child="accessible">
-                              <object class="AtkObject">
-                                <property name="accessible-name" translatable="yes">Go back</property>
-                              </object>
-                            </child>
-                            <style>
-                              <class name="image-button"/>
-                            </style>
-                            <child>
-                              <object class="GtkImage" id="back_image">
-                                <property name="visible">True</property>
-                                <property name="icon_name">go-previous-symbolic</property>
-                                <property name="icon_size">1</property>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                        <child type="title">
-                          <object class="GtkLabel" id="sub_page_header_title">
-                            <property name="visible">True</property>
-                            <property name="selectable">False</property>
-                            <property name="ellipsize">end</property>
-                            <style>
-                              <class name="title"/>
-                            </style>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-                <child>
-                  <object class="HdyHeaderBar" id="details_header">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="show-close-button">True</property>
-                    <child>
-                      <object class="GtkButton">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <signal name="clicked" handler="gs_shell_details_back_button_cb"/>
-                        <child internal-child="accessible">
-                          <object class="AtkObject">
-                            <property name="accessible-name" translatable="yes">Go back</property>
-                          </object>
-                        </child>
-                        <style>
-                          <class name="image-button"/>
-                        </style>
-                        <child>
-                          <object class="GtkImage">
-                            <property name="visible">True</property>
-                            <property name="icon_name">go-previous-symbolic</property>
-                            <property name="icon_size">1</property>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                    <child type="title">
-                      <object class="GtkLabel" id="application_details_header">
-                        <property name="visible">True</property>
-                        <property name="selectable">False</property>
-                        <property name="ellipsize">end</property>
-                        <style>
-                          <class name="title"/>
-                        </style>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-
             <child>
               <object class="GtkOverlay" id="overlay">
                 <property name="visible">True</property>
@@ -312,15 +146,81 @@
                       <object class="HdyDeck" id="main_deck">
                         <property name="visible">True</property>
                         <signal name="notify::visible-child" handler="stack_notify_visible_child_cb"/>
-                        <child>
-                          <object class="GtkBox">
-                            <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
                                 <child>
                                   <object class="GtkBox" id="main_box">
                                     <property name="visible">True</property>
                                     <property name="orientation">vertical</property>
-
+                                    <child>
+                                      <object class="HdyHeaderBar" id="main_header">
+                                        <property name="visible">True</property>
+                                        <property name="can-focus">False</property>
+                                        <property name="hexpand">True</property>
+                                        <property name="show-close-button">True</property>
+                                        <property name="centering-policy">strict</property>
+                                        <child>
+                                          <object class="GtkToggleButton" id="search_button_main">
+                                            <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">
+                                                <property name="accessible-name" 
translatable="yes">Search</property>
+                                              </object>
+                                            </child>
+                                            <style>
+                                              <class name="image-button"/>
+                                            </style>
+                                            <child>
+                                              <object class="GtkImage">
+                                                <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>
+                                          <object class="GtkMenuButton" id="menu_button_main">
+                                            <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 type="title">
+                                          <object class="HdyViewSwitcherTitle" id="title_switcher">
+                                            <property name="visible">True</property>
+                                            <property name="stack">stack_main</property>
+                                            <property name="title" bind-source="GsShell" 
bind-property="title" bind-flags="sync-create"/>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
                                     <child>
                                       <object class="HdySearchBar" id="search_bar">
                                         <property name="visible">True</property>
@@ -445,8 +345,6 @@
                                         </child>
                                       </object>
                                     </child>
-                                  </object>
-                                </child>
                             <child>
                               <object class="HdyViewSwitcherBar" id="sidebar_switcher">
                                 <property name="visible">True</property>
@@ -459,6 +357,50 @@
                             <property name="name">main</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="GtkBox" id="sub_box">
+                            <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="HdyHeaderBar" id="sub_header">
+                                <property name="visible">True</property>
+                                <property name="can-focus">False</property>
+                                <property name="hexpand">True</property>
+                                <property name="show-close-button">True</property>
+                                <child>
+                                  <object class="GtkButton" id="button_back">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <signal name="clicked" handler="gs_shell_back_button_cb"/>
+                                    <child internal-child="accessible">
+                                      <object class="AtkObject">
+                                        <property name="accessible-name" translatable="yes">Go 
back</property>
+                                      </object>
+                                    </child>
+                                    <style>
+                                      <class name="image-button"/>
+                                    </style>
+                                    <child>
+                                      <object class="GtkImage" id="back_image">
+                                        <property name="visible">True</property>
+                                        <property name="icon_name">go-previous-symbolic</property>
+                                        <property name="icon_size">1</property>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="title">
+                                  <object class="GtkLabel" id="sub_page_header_title">
+                                    <property name="visible">True</property>
+                                    <property name="selectable">False</property>
+                                    <property name="ellipsize">end</property>
+                                    <style>
+                                      <class name="title"/>
+                                    </style>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
                         <child>
                           <object class="GtkStack" id="stack_sub">
                             <property name="visible">True</property>
@@ -491,6 +433,8 @@
                               </packing>
                             </child>
                           </object>
+                        </child>
+                          </object>
                           <packing>
                             <property name="name">sub</property>
                           </packing>
@@ -501,8 +445,54 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GsDetailsPage" id="details_page">
+                      <object class="GtkBox" id="details_box">
                         <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
+                        <child>
+                          <object class="HdyHeaderBar" id="details_header">
+                            <property name="visible">True</property>
+                            <property name="can-focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="show-close-button">True</property>
+                            <child>
+                              <object class="GtkButton">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <signal name="clicked" handler="gs_shell_details_back_button_cb"/>
+                                <child internal-child="accessible">
+                                  <object class="AtkObject">
+                                    <property name="accessible-name" translatable="yes">Go back</property>
+                                  </object>
+                                </child>
+                                <style>
+                                  <class name="image-button"/>
+                                </style>
+                                <child>
+                                  <object class="GtkImage">
+                                    <property name="visible">True</property>
+                                    <property name="icon_name">go-previous-symbolic</property>
+                                    <property name="icon_size">1</property>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
+                            <child type="title">
+                              <object class="GtkLabel" id="application_details_header">
+                                <property name="visible">True</property>
+                                <property name="selectable">False</property>
+                                <property name="ellipsize">end</property>
+                                <style>
+                                  <class name="title"/>
+                                </style>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GsDetailsPage" id="details_page">
+                            <property name="visible">True</property>
+                          </object>
+                        </child>
                       </object>
                       <packing>
                         <property name="name">details</property>
@@ -510,8 +500,6 @@
                     </child>
                   </object>
                 </child>
-              </object>
-            </child>
           </object>
           <packing>
             <property name="name">main</property>
@@ -546,18 +534,4 @@
       </object>
     </child>
   </template>
-
-  <object class="HdySwipeGroup">
-    <swipeables>
-      <swipeable name="header_deck"/>
-      <swipeable name="main_deck"/>
-    </swipeables>
-  </object>
-
-  <object class="HdySwipeGroup">
-    <swipeables>
-      <swipeable name="details_header_deck"/>
-      <swipeable name="details_deck"/>
-    </swipeables>
-  </object>
 </interface>


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