[libadwaita/wip/exalm/adaptive-states: 7/7] demo: Port view switcher demo to adaptive states




commit d35f52d502355ccd64c241013953890dd5a27a4c
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Oct 4 14:39:50 2022 +0400

    demo: Port view switcher demo to adaptive states

 .../view-switcher/adw-view-switcher-demo-window.ui    | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 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 2b832c21..6c9cc9b7 100644
--- a/demo/pages/view-switcher/adw-view-switcher-demo-window.ui
+++ b/demo/pages/view-switcher/adw-view-switcher-demo-window.ui
@@ -6,17 +6,20 @@
   <template class="AdwViewSwitcherDemoWindow" parent="AdwWindow">
     <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="content">
       <object class="GtkBox">
         <property name="orientation">vertical</property>
         <child>
-          <object class="AdwHeaderBar">
+          <object class="AdwHeaderBar" id="header_bar">
             <property name="centering-policy">strict</property>
             <property name="title-widget">
-              <object class="AdwViewSwitcherTitle" id="switcher_title">
+              <object class="AdwViewSwitcher" id="switcher">
                 <property name="stack">stack</property>
-                <property name="title" bind-source="AdwViewSwitcherDemoWindow" bind-property="title" 
bind-flags="sync-create"/>
+                <property name="policy">wide</property>
               </object>
             </property>
           </object>
@@ -99,10 +102,18 @@
         <child>
           <object class="AdwViewSwitcherBar" id="switcher_bar">
             <property name="stack">stack</property>
-            <property name="reveal" bind-source="switcher_title" bind-property="title-visible" 
bind-flags="sync-create"/>
           </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]