[gnome-todo] Port to GtkStackPage



commit 6a17266d7f7e04f8a90e108c2397314dd7ef98ae
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Feb 13 19:15:56 2019 -0200

    Port to GtkStackPage

 src/gtd-plugin-dialog.ui                 |  51 ++++---
 src/provider/gtd-provider-popover.ui     | 246 ++++++++++++++++---------------
 src/sidebar/gtd-sidebar-provider-row.ui  |  23 +--
 src/task-list-view/gtd-task-list-view.ui |  80 +++++-----
 4 files changed, 209 insertions(+), 191 deletions(-)
---
diff --git a/src/gtd-plugin-dialog.ui b/src/gtd-plugin-dialog.ui
index 6e7cfbf..274f47b 100644
--- a/src/gtd-plugin-dialog.ui
+++ b/src/gtd-plugin-dialog.ui
@@ -19,39 +19,46 @@
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="interpolate_size">True</property>
+
             <child>
-              <object class="GtkScrolledWindow">
-                <property name="can_focus">True</property>
-                <property name="propagate_natural_width">True</property>
-                <child>
-                  <object class="GtkViewport">
-                    <property name="can_focus">False</property>
-                    <property name="shadow_type">none</property>
+              <object class="GtkStackPage">
+                <property name="name">list</property>
+                <property name="child">
+                  <object class="GtkScrolledWindow">
+                    <property name="can_focus">True</property>
+                    <property name="propagate_natural_width">True</property>
                     <child>
-                      <object class="GtkListBox" id="listbox">
+                      <object class="GtkViewport">
                         <property name="can_focus">False</property>
-                        <property name="selection_mode">none</property>
-                        <style>
-                          <class name="extension-list" />
-                        </style>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkListBox" id="listbox">
+                            <property name="can_focus">False</property>
+                            <property name="selection_mode">none</property>
+                            <style>
+                              <class name="extension-list" />
+                            </style>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
-                </child>
+                </property>
               </object>
-              <packing>
-                <property name="name">list</property>
-              </packing>
             </child>
+
             <child>
-              <object class="GtkFrame" id="frame">
-                <property name="can_focus">False</property>
-                <property name="shadow_type">none</property>
-              </object>
-              <packing>
+              <object class="GtkStackPage">
                 <property name="name">config</property>
-              </packing>
+                <property name="child">
+                  <object class="GtkFrame" id="frame">
+                    <property name="can_focus">False</property>
+                    <property name="shadow_type">none</property>
+                  </object>
+                </property>
+              </object>
             </child>
+
           </object>
         </child>
       </object>
diff --git a/src/provider/gtd-provider-popover.ui b/src/provider/gtd-provider-popover.ui
index 9e24a62..8458fc7 100644
--- a/src/provider/gtd-provider-popover.ui
+++ b/src/provider/gtd-provider-popover.ui
@@ -12,149 +12,155 @@
         <property name="interpolate_size">True</property>
         <property name="transition_duration">300</property>
         <property name="transition_type">slide-left-right</property>
+
         <child>
-          <object class="GtkGrid" id="new_list_popover_grid">
-            <property name="can_focus">False</property>
-            <property name="hexpand">True</property>
-            <property name="row_spacing">12</property>
-            <property name="column_spacing">12</property>
-            <child>
-              <object class="GtkButton" id="new_list_create_button">
-                <property name="label" translatable="yes">Create _List</property>
-                <property name="use_underline">True</property>
-                <property name="sensitive">False</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <signal name="clicked" handler="gtd_provider_popover__action_button_clicked" 
object="GtdProviderPopover" swapped="yes" />
-                <style>
-                  <class name="suggested-action"/>
-                </style>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="new_list_cancel_button">
-                <property name="label" translatable="yes">_Cancel</property>
-                <property name="use_underline">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <signal name="clicked" handler="gtd_provider_popover__action_button_clicked" 
object="GtdProviderPopover" swapped="yes" />
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="new_list_popover_dim_label">
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">List Name</property>
-                <property name="xalign">0</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-                <property name="width">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkBox" id="location_box">
+          <object class="GtkStackPage">
+            <property name="name">selector</property>
+            <property name="child">
+              <object class="GtkGrid" id="new_list_popover_grid">
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="row_spacing">12</property>
+                <property name="column_spacing">12</property>
                 <child>
-                  <object class="GtkEntry" id="new_list_name_entry">
+                  <object class="GtkButton" id="new_list_create_button">
+                    <property name="label" translatable="yes">Create _List</property>
+                    <property name="use_underline">True</property>
+                    <property name="sensitive">False</property>
                     <property name="can_focus">True</property>
-                    <property name="hexpand">True</property>
-                    <property name="width_chars">35</property>
-                    <signal name="notify::text" handler="gtd_provider_popover__text_changed_cb" 
object="GtdProviderPopover" swapped="yes" />
-                    <signal name="activate" handler="gtd_provider_popover__entry_activate" 
object="GtdProviderPopover" swapped="yes" />
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="gtd_provider_popover__action_button_clicked" 
object="GtdProviderPopover" swapped="yes" />
+                    <style>
+                      <class name="suggested-action"/>
+                    </style>
                   </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">2</property>
+                  </packing>
                 </child>
                 <child>
-                  <object class="GtkButton" id="change_location_button">
+                  <object class="GtkButton" id="new_list_cancel_button">
+                    <property name="label" translatable="yes">_Cancel</property>
+                    <property name="use_underline">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
-                    <property name="sensitive">True</property>
-                    <signal name="clicked" handler="gtd_provider_popover__change_location_clicked" 
object="GtdProviderPopover" swapped="yes" />
+                    <signal name="clicked" handler="gtd_provider_popover__action_button_clicked" 
object="GtdProviderPopover" swapped="yes" />
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="new_list_popover_dim_label">
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">List Name</property>
+                    <property name="xalign">0</property>
+                    <style>
+                      <class name="dim-label"/>
+                    </style>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="location_box">
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkEntry" id="new_list_name_entry">
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="width_chars">35</property>
+                        <signal name="notify::text" handler="gtd_provider_popover__text_changed_cb" 
object="GtdProviderPopover" swapped="yes" />
+                        <signal name="activate" handler="gtd_provider_popover__entry_activate" 
object="GtdProviderPopover" swapped="yes" />
+                      </object>
+                    </child>
                     <child>
-                      <object class="GtkImage" id="location_provider_image">
-                        <property name="can_focus">False</property>
-                        <property name="pixel_size">16</property>
-                        <property name="icon_name">goa-account</property>
+                      <object class="GtkButton" id="change_location_button">
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="sensitive">True</property>
+                        <signal name="clicked" handler="gtd_provider_popover__change_location_clicked" 
object="GtdProviderPopover" swapped="yes" />
+                        <child>
+                          <object class="GtkImage" id="location_provider_image">
+                            <property name="can_focus">False</property>
+                            <property name="pixel_size">16</property>
+                            <property name="icon_name">goa-account</property>
+                          </object>
+                        </child>
                       </object>
                     </child>
+                    <style>
+                      <class name="linked"/>
+                    </style>
                   </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">2</property>
+                  </packing>
                 </child>
-                <style>
-                  <class name="linked"/>
-                </style>
               </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">1</property>
-                <property name="width">2</property>
-              </packing>
-            </child>
+            </property>
           </object>
-          <packing>
-            <property name="name">main</property>
-          </packing>
         </child>
+
         <child>
-          <object class="GtkGrid" id="selector_grid">
-            <property name="column_spacing">12</property>
-            <property name="row_spacing">12</property>
-            <child>
-              <object class="GtkButton" id="back_button">
-                <property name="halign">start</property>
-                <signal name="clicked" handler="gtd_provider_popover__change_location_clicked" 
object="GtdProviderPopover" swapped="yes" />
+          <object class="GtkStackPage">
+            <property name="name">selector</property>
+            <property name="child">
+              <object class="GtkGrid" id="selector_grid">
+                <property name="column_spacing">12</property>
+                <property name="row_spacing">12</property>
                 <child>
-                  <object class="GtkImage" id="back_image">
-                    <property name="icon-name">go-previous-symbolic</property>
-                    <property name="pixel-size">16</property>
+                  <object class="GtkButton" id="back_button">
+                    <property name="halign">start</property>
+                    <signal name="clicked" handler="gtd_provider_popover__change_location_clicked" 
object="GtdProviderPopover" swapped="yes" />
+                    <child>
+                      <object class="GtkImage" id="back_image">
+                        <property name="icon-name">go-previous-symbolic</property>
+                        <property name="pixel-size">16</property>
+                      </object>
+                    </child>
                   </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="title_label">
+                    <property name="hexpand">True</property>
+                    <property name="label" translatable="yes">Select a storage location</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtdProviderSelector" id="provider_selector">
+                    <property name="can_focus">True</property>
+                    <property name="show_local">True</property>
+                    <property name="select_default">True</property>
+                    <property name="show_stub_rows">False</property>
+                    <signal name="provider-selected" handler="gtd_provider_popover__provider_selected" 
object="GtdProviderPopover" swapped="yes" />
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">2</property>
+                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="title_label">
-                <property name="hexpand">True</property>
-                <property name="label" translatable="yes">Select a storage location</property>
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtdProviderSelector" id="provider_selector">
-                <property name="can_focus">True</property>
-                <property name="show_local">True</property>
-                <property name="select_default">True</property>
-                <property name="show_stub_rows">False</property>
-                <signal name="provider-selected" handler="gtd_provider_popover__provider_selected" 
object="GtdProviderPopover" swapped="yes" />
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">1</property>
-                <property name="width">2</property>
-              </packing>
-            </child>
+            </property>
           </object>
-          <packing>
-            <property name="name">selector</property>
-          </packing>
         </child>
       </object>
     </child>
diff --git a/src/sidebar/gtd-sidebar-provider-row.ui b/src/sidebar/gtd-sidebar-provider-row.ui
index a852723..dc53970 100644
--- a/src/sidebar/gtd-sidebar-provider-row.ui
+++ b/src/sidebar/gtd-sidebar-provider-row.ui
@@ -46,23 +46,24 @@
 
                 <!-- Loading spinner -->
                 <child>
-                  <object class="GtkSpinner">
-                    <property name="can_focus">False</property>
-                    <property name="active">True</property>
-                  </object>
-                  <packing>
+                  <object class="GtkStackPage">
                     <property name="name">spinner</property>
-                  </packing>
+                    <property name="child">
+                      <object class="GtkSpinner">
+                        <property name="active">True</property>
+                      </object>
+                    </property>
+                  </object>
                 </child>
 
                 <!-- Drop down icon -->
                 <child>
-                  <object class="GtkBox">
-                    <property name="can_focus">False</property>
-                  </object>
-                  <packing>
+                  <object class="GtkStackPage">
                     <property name="name">empty</property>
-                  </packing>
+                    <property name="child">
+                      <object class="GtkBox" />
+                    </property>
+                  </object>
                 </child>
 
               </object>
diff --git a/src/task-list-view/gtd-task-list-view.ui b/src/task-list-view/gtd-task-list-view.ui
index baca0ec..63281f0 100644
--- a/src/task-list-view/gtd-task-list-view.ui
+++ b/src/task-list-view/gtd-task-list-view.ui
@@ -26,53 +26,57 @@
 
                 <!-- Listbox -->
                 <child>
-                  <object class="GtkBox">
-                    <property name="can_focus">false</property>
-                    <property name="margin-top">6</property>
-                    <property name="margin-bottom">64</property>
-                    <property name="margin-start">18</property>
-                    <property name="margin-end">18</property>
-                    <property name="orientation">vertical</property>
+                  <object class="GtkStackPage">
+                    <property name="name">listbox</property>
+                    <property name="child">
+                      <object class="GtkBox">
+                        <property name="can_focus">false</property>
+                        <property name="margin-top">6</property>
+                        <property name="margin-bottom">64</property>
+                        <property name="margin-start">18</property>
+                        <property name="margin-end">18</property>
+                        <property name="orientation">vertical</property>
 
-                    <child>
-                      <object class="GtkListBox" id="listbox">
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="selection_mode">none</property>
-                        <signal name="drag-drop" handler="listbox_drag_drop" object="GtdTaskListView" 
swapped="no" />
-                        <signal name="drag-leave" handler="listbox_drag_leave" object="GtdTaskListView" 
swapped="no" />
-                        <signal name="drag-motion" handler="listbox_drag_motion" object="GtdTaskListView" 
swapped="no" />
-                        <signal name="row-activated" handler="on_listbox_row_activated_cb" 
object="GtdTaskListView" swapped="no" />
-                        <style>
-                          <class name="transparent" />
-                        </style>
-                      </object>
-                    </child>
+                        <child>
+                          <object class="GtkListBox" id="listbox">
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="selection_mode">none</property>
+                            <signal name="drag-drop" handler="listbox_drag_drop" object="GtdTaskListView" 
swapped="no" />
+                            <signal name="drag-leave" handler="listbox_drag_leave" object="GtdTaskListView" 
swapped="no" />
+                            <signal name="drag-motion" handler="listbox_drag_motion" 
object="GtdTaskListView" swapped="no" />
+                            <signal name="row-activated" handler="on_listbox_row_activated_cb" 
object="GtdTaskListView" swapped="no" />
+                            <style>
+                              <class name="transparent" />
+                            </style>
+                          </object>
+                        </child>
 
-                    <child>
-                      <object class="GtdNewTaskRow" id="new_task_row">
-                        <property name="margin-bottom">24</property>
-                        <signal name="enter" handler="on_new_task_row_entered_cb" object="GtdTaskListView" 
swapped="yes" />
-                        <signal name="exit" handler="on_new_task_row_exited_cb" object="GtdTaskListView" 
swapped="yes" />
+                        <child>
+                          <object class="GtdNewTaskRow" id="new_task_row">
+                            <property name="margin-bottom">24</property>
+                            <signal name="enter" handler="on_new_task_row_entered_cb" 
object="GtdTaskListView" swapped="yes" />
+                            <signal name="exit" handler="on_new_task_row_exited_cb" object="GtdTaskListView" 
swapped="yes" />
+                          </object>
+                        </child>
                       </object>
-                    </child>
+                    </property>,
                   </object>
-                  <packing>
-                    <property name="name">listbox</property>
-                  </packing>
                 </child>
 
                 <!-- Spinner -->
                 <child>
-                  <object class="GtkSpinner">
-                    <property name="can_focus">False</property>
-                    <property name="active">True</property>
-                    <property name="width-request">96</property>
-                    <property name="height-request">96</property>
-                  </object>
-                  <packing>
+                  <object class="GtkStackPage">
                     <property name="name">loading</property>
-                  </packing>
+                    <property name="child">
+                      <object class="GtkSpinner">
+                        <property name="can_focus">False</property>
+                        <property name="active">True</property>
+                        <property name="width-request">96</property>
+                        <property name="height-request">96</property>
+                      </object>
+                    </property>
+                  </object>
                 </child>
 
               </object>


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