[libadwaita/wip/exalm/borderless: 14/14] example




commit 2fdd74775c25c323f412812bed79aa4b040a974a
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Jul 4 18:57:30 2021 +0500

    example

 examples/adw-view-switcher-demo-window.ui | 363 ++++++++++++++++++++++++++----
 1 file changed, 322 insertions(+), 41 deletions(-)
---
diff --git a/examples/adw-view-switcher-demo-window.ui b/examples/adw-view-switcher-demo-window.ui
index 28a0c10c..a9e57727 100644
--- a/examples/adw-view-switcher-demo-window.ui
+++ b/examples/adw-view-switcher-demo-window.ui
@@ -3,21 +3,185 @@
 <interface>
   <requires lib="gtk" version="4.0"/>
   <requires lib="libadwaita" version="1.0"/>
+  <menu id="menu">
+    <section>
+      <item>
+        <attribute name="label">Something</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label">Preferences</attribute>
+      </item>
+      <item>
+        <attribute name="label">About Demo</attribute>
+      </item>
+    </section>
+  </menu>
+  <menu id="primary_menu">
+    <item>
+      <attribute name="custom">zoom-controls</attribute>
+    </item>
+    <section>
+      <item>
+        <attribute name="label">Something</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label">Preferences</attribute>
+      </item>
+      <item>
+        <attribute name="label">About Demo</attribute>
+      </item>
+    </section>
+  </menu>
   <template class="AdwViewSwitcherDemoWindow" parent="AdwWindow">
-    <property name="modal">True</property>
     <property name="title" translatable="yes">AdwViewSwitcher Demo</property>
-    <child>
+    <property name="default-width">800</property>
+    <property name="default-height">600</property>
+    <property name="content">
       <object class="GtkBox">
         <property name="orientation">vertical</property>
         <child>
           <object class="AdwHeaderBar">
-            <property name="centering-policy">strict</property>
             <property name="title-widget">
-              <object class="AdwViewSwitcherTitle" id="switcher_title">
+              <object class="AdwViewSwitcherTitle">
+                <binding name="title">
+                  <lookup name="title">AdwViewSwitcherDemoWindow</lookup>
+                </binding>
                 <property name="stack">stack</property>
-                <property name="title" bind-source="AdwViewSwitcherDemoWindow" bind-property="title" 
bind-flags="sync-create"/>
               </object>
             </property>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">go-previous-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">go-next-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">view-refresh-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">tab-new-symbolic</property>
+              </object>
+            </child>
+            <property name="title-widget">
+              <object class="GtkEntry">
+                <property name="placeholder-text">Search for websites, bookmarks and open tabs</property>
+              </object>
+            </property>
+            <child type="end">
+              <object class="GtkMenuButton">
+                <property name="icon-name">open-menu-symbolic</property>
+                <property name="popover">
+                  <object class="GtkPopoverMenu">
+                    <property name="menu-model">primary_menu</property>
+                    <child type="zoom-controls">
+                      <object class="GtkBox">
+                        <property name="homogeneous">True</property>
+                        <style>
+                          <class name="linked"/>
+                        </style>
+                        <child>
+                          <object class="GtkButton">
+                            <property name="icon-name">zoom-out-symbolic</property>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkButton">
+                            <property name="sensitive">False</property>
+                            <child>
+                              <object class="GtkLabel" id="zoom_level">
+                                <property name="label" translatable="yes">100%</property>
+                                <property name="width-chars">5</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkButton">
+                            <property name="icon-name">zoom-in-symbolic</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </property>
+              </object>
+            </child>
+            <child type="end">
+              <object class="GtkMenuButton">
+                <property name="icon-name">document-open-symbolic</property>
+                <property name="always-show-arrow">True</property>
+                <property name="menu-model">menu</property>
+              </object>
+            </child>
+            <child type="end">
+              <object class="AdwSplitButton">
+                <property name="icon-name">media-playback-start-symbolic</property>
+                <property name="menu-model">menu</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <style>
+              <class name="toolbar"/>
+            </style>
+            <child>
+              <object class="GtkBox">
+                <style>
+                  <class name="linked"/>
+                </style>
+                <child>
+                  <object class="GtkSearchEntry"/>
+                </child>
+                <child>
+                  <object class="GtkButton">
+                    <property name="icon-name">go-up-symbolic</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkButton">
+                    <property name="icon-name">go-down-symbolic</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">edit-find-symbolic</property>
+                <property name="hexpand">True</property>
+                <property name="halign">end</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">edit-find-replace-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkMenuButton">
+                <property name="icon-name">view-more-symbolic</property>
+                <property name="menu-model">menu</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <style>
+              <class name="sidebar"/>
+            </style>
           </object>
         </child>
         <child>
@@ -25,66 +189,50 @@
             <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="title">World</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 class="AdwStatusPage">
+                    <property name="icon-name">clock-world-symbolic</property>
+                    <property name="title">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="title">Alarms</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="AdwStatusPage">
+                    <property name="icon-name">clock-alarm-symbolic</property>
+                    <property name="title">Alarms</property>
                   </object>
                 </property>
               </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="title">Stopwatch</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 class="AdwStatusPage">
+                    <property name="icon-name">clock-stopwatch-symbolic</property>
+                    <property name="title">Stopwatch</property>
                   </object>
                 </property>
               </object>
             </child>
             <child>
               <object class="AdwViewStackPage">
-                <property name="name">page4</property>
-                <property name="title" translatable="yes">Timer</property>
                 <property name="icon-name">clock-timer-symbolic</property>
+                <property name="title">Timer</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">Timer</property>
+                  <object class="AdwStatusPage">
+                    <property name="icon-name">clock-timer-symbolic</property>
+                    <property name="title">Timer</property>
                   </object>
                 </property>
               </object>
@@ -92,12 +240,145 @@
           </object>
         </child>
         <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 class="GtkSeparator">
+            <style>
+              <class name="sidebar"/>
+            </style>
+          </object>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <style>
+              <class name="toolbar"/>
+            </style>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">format-text-bold-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">format-text-italic-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">format-text-underline-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">format-text-strikethrough-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkSeparator"/>
+            </child>
+            <child>
+              <object class="GtkToggleButton" id="bold">
+                <property name="icon-name">format-justify-left-symbolic</property>
+                <property name="active">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">format-justify-center-symbolic</property>
+                <property name="group">bold</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">format-justify-right-symbolic</property>
+                <property name="group">bold</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="icon-name">format-justify-fill-symbolic</property>
+                <property name="group">bold</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkVolumeButton">
+              </object>
+            </child>
+            <child>
+              <object class="GtkVolumeButton">
+              </object>
+            </child>
+            <child>
+              <object class="GtkSeparator"/>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">format-indent-less-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">format-indent-more-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkSeparator"/>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">insert-image-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">insert-link-symbolic</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton">
+                <property name="icon-name">insert-object-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkActionBar">
+            <child type="center">
+              <object class="AdwViewSwitcherTitle">
+                <binding name="title">
+                  <lookup name="title">AdwViewSwitcherDemoWindow</lookup>
+                </binding>
+                <property name="stack">stack</property>
+              </object>
+            </child>
+            <child type="start">
+              <object class="GtkMenuButton">
+                <property name="label">Open</property>
+                <property name="menu-model">menu</property>
+              </object>
+            </child>
+            <child type="start">
+              <object class="GtkButton">
+                <property name="icon-name">document-print-symbolic</property>
+              </object>
+            </child>
+            <child type="start">
+              <object class="GtkButton">
+                <property name="icon-name">user-trash-symbolic</property>
+              </object>
+            </child>
+            <child type="end">
+              <object class="GtkButton">
+                <property name="label">Properties</property>
+              </object>
+            </child>
+            <child type="end">
+              <object class="AdwSplitButton">
+                <property name="label">Open</property>
+                <property name="menu-model">menu</property>
+              </object>
+            </child>
           </object>
         </child>
       </object>
-    </child>
+    </property>
   </template>
 </interface>


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