[libadwaita/wip/exalm/browsing-view: 5/5] demo




commit bbe51a6f4a8ffdde7c1ffebfce4c3322555ce3a6
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Oct 9 02:16:57 2022 +0400

    demo

 .../view-switcher/adw-view-switcher-demo-window.ui | 233 +++++++++++++--------
 1 file changed, 144 insertions(+), 89 deletions(-)
---
diff --git a/demo/pages/view-switcher/adw-view-switcher-demo-window.ui 
b/demo/pages/view-switcher/adw-view-switcher-demo-window.ui
index 6c9cc9b7..28164f81 100644
--- a/demo/pages/view-switcher/adw-view-switcher-demo-window.ui
+++ b/demo/pages/view-switcher/adw-view-switcher-demo-window.ui
@@ -7,113 +7,168 @@
     <property name="modal">True</property>
     <property name="width-request">360</property>
     <property name="height-request">150</property>
-    <property name="default-width">640</property>
-    <property name="default-height">320</property>
-    <property name="title" translatable="yes">AdwViewSwitcher Demo</property>
+    <property name="default-width">800</property>
+    <property name="default-height">600</property>
+    <property name="title" translatable="yes">AdwBrowsingView Demo</property>
     <property name="content">
-      <object class="GtkBox">
-        <property name="orientation">vertical</property>
+      <object class="AdwBrowsingView">
         <child>
-          <object class="AdwHeaderBar" id="header_bar">
-            <property name="centering-policy">strict</property>
-            <property name="title-widget">
-              <object class="AdwViewSwitcher" id="switcher">
-                <property name="stack">stack</property>
-                <property name="policy">wide</property>
+          <object class="AdwBrowsingViewChild">
+            <property name="title">Page 1</property>
+            <property name="child-name">page-1</property>
+            <property name="child">
+              <object class="GtkBox">
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="AdwHeaderBar"/>
+                </child>
+                <child>
+                  <object class="GtkBox">
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">12</property>
+                    <property name="vexpand">True</property>
+                    <property name="valign">center</property>
+                    <property name="halign">center</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="label" translatable="yes">Page 1</property>
+                        <style>
+                          <class name="title-1"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkButton">
+                        <property name="label" translatable="yes">Page 2</property>
+                        <property name="action-name">browsing.push</property>
+                        <property name="action-target">"page-2"</property>
+                        <style>
+                          <class name="pill"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkButton">
+                        <property name="label" translatable="yes">Page 3</property>
+                        <property name="action-name">browsing.push</property>
+                        <property name="action-target">"page-3"</property>
+                        <style>
+                          <class name="pill"/>
+                        </style>
+                      </object>
+                    </child>
+                  </object>
+                </child>
               </object>
             </property>
           </object>
         </child>
         <child>
-          <object class="AdwViewStack" id="stack">
-            <property name="vexpand">True</property>
-            <child>
-              <object class="AdwViewStackPage">
-                <property name="name">page1</property>
-                <property name="title" translatable="yes">_World</property>
-                <property name="icon-name">clock-world-symbolic</property>
-                <property name="use-underline">True</property>
-                <property name="child">
-                  <object class="GtkLabel">
-                    <property name="margin-top">24</property>
-                    <property name="margin-bottom">24</property>
-                    <property name="margin-start">24</property>
-                    <property name="margin-end">24</property>
-                    <property name="label" translatable="yes">World</property>
-                  </object>
-                </property>
-              </object>
-            </child>
-            <child>
-              <object class="AdwViewStackPage">
-                <property name="name">page2</property>
-                <property name="title" translatable="yes">_Alarm</property>
-                <property name="icon-name">clock-alarm-symbolic</property>
-                <property name="use-underline">True</property>
-                <property name="child">
-                  <object class="GtkLabel">
-                    <property name="margin-top">24</property>
-                    <property name="margin-bottom">24</property>
-                    <property name="margin-start">24</property>
-                    <property name="margin-end">24</property>
-                    <property name="label" translatable="yes">Alarm</property>
+          <object class="AdwBrowsingViewChild">
+            <property name="title">Page 2</property>
+            <property name="child-name">page-2</property>
+            <property name="child">
+              <object class="GtkBox">
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="AdwHeaderBar"/>
+                </child>
+                <child>
+                  <object class="GtkBox">
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">12</property>
+                    <property name="vexpand">True</property>
+                    <property name="valign">center</property>
+                    <property name="halign">center</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="label" translatable="yes">Page 2</property>
+                        <style>
+                          <class name="title-1"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkButton">
+                        <property name="label" translatable="yes">Page 4</property>
+                        <property name="action-name">browsing.push</property>
+                        <property name="action-target">"page-4"</property>
+                        <style>
+                          <class name="pill"/>
+                        </style>
+                      </object>
+                    </child>
                   </object>
-                </property>
+                </child>
               </object>
-            </child>
-            <child>
-              <object class="AdwViewStackPage">
-                <property name="name">page3</property>
-                <property name="title" translatable="yes">_Stopwatch</property>
-                <property name="icon-name">clock-stopwatch-symbolic</property>
-                <property name="badge-number">3</property>
-                <property name="needs-attention">true</property>
-                <property name="use-underline">True</property>
-                <property name="child">
-                  <object class="GtkLabel">
-                    <property name="margin-top">24</property>
-                    <property name="margin-bottom">24</property>
-                    <property name="margin-start">24</property>
-                    <property name="margin-end">24</property>
-                    <property name="label" translatable="yes">Stopwatch</property>
-                  </object>
-                </property>
-              </object>
-            </child>
-            <child>
-              <object class="AdwViewStackPage">
-                <property name="name">page4</property>
-                <property name="title" translatable="yes">Tim_er</property>
-                <property name="icon-name">clock-timer-symbolic</property>
-                <property name="use-underline">True</property>
-                <property name="child">
+            </property>
+          </object>
+        </child>
+        <child>
+          <object class="AdwBrowsingViewChild">
+            <property name="title">Page 3</property>
+            <property name="child-name">page-3</property>
+            <property name="child">
+              <object class="GtkBox">
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="AdwHeaderBar"/>
+                </child>
+                <child>
                   <object class="GtkLabel">
-                    <property name="margin-top">24</property>
-                    <property name="margin-bottom">24</property>
-                    <property name="margin-start">24</property>
-                    <property name="margin-end">24</property>
-                    <property name="label" translatable="yes">Timer</property>
+                    <property name="vexpand">True</property>
+                    <property name="label" translatable="yes">Page 3</property>
+                    <style>
+                      <class name="title-1"/>
+                    </style>
                   </object>
-                </property>
+                </child>
               </object>
-            </child>
+            </property>
           </object>
         </child>
         <child>
-          <object class="AdwViewSwitcherBar" id="switcher_bar">
-            <property name="stack">stack</property>
+          <object class="AdwBrowsingViewChild">
+            <property name="title">Page 4</property>
+            <property name="child-name">page-4</property>
+            <property name="child">
+              <object class="GtkBox">
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="AdwHeaderBar"/>
+                </child>
+                <child>
+                  <object class="GtkBox">
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">12</property>
+                    <property name="vexpand">True</property>
+                    <property name="valign">center</property>
+                    <property name="halign">center</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="label" translatable="yes">Page 4</property>
+                        <style>
+                          <class name="title-1"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkButton">
+                        <property name="label" translatable="yes">Page 3</property>
+                        <property name="action-name">browsing.push</property>
+                        <property name="action-target">"page-3"</property>
+                        <style>
+                          <class name="pill"/>
+                        </style>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </property>
           </object>
         </child>
       </object>
     </property>
-    <child>
-      <object class="AdwAdaptiveState">
-        <conditions>
-          <condition type="max-width">600</condition>
-        </conditions>
-        <setter object="switcher_bar" property="reveal">True</setter>
-        <setter object="header_bar" property="title-widget"/>
-      </object>
-    </child>
   </template>
 </interface>


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