[gnome-bluetooth/wip/cdavis/adw-header-suffixes] settings-widget: Simplify via `header-suffix`




commit 9f5fee84d655bc309b8a69158ccf54737a0eba2f
Author: Christopher Davis <christopherdavis gnome org>
Date:   Thu Jan 27 02:49:42 2022 -0800

    settings-widget: Simplify via `header-suffix`
    
    Now that libadwaita has the header-suffix property,
    we can use AdwPreferencesGroup's built-in header.

 lib/settings.ui | 71 +++++++++++++++++++++------------------------------------
 meson.build     |  2 +-
 2 files changed, 27 insertions(+), 46 deletions(-)
---
diff --git a/lib/settings.ui b/lib/settings.ui
index a80bcfa3..4af932a0 100644
--- a/lib/settings.ui
+++ b/lib/settings.ui
@@ -182,60 +182,41 @@
     </child>
     <child>
       <object class="AdwPreferencesGroup" id="devices_group">
+        <property name="title" translatable="yes">Devices</property>
+        <property name="header-suffix">
+          <object class="GtkSpinner" id="device_spinner"/>
+        </property>
         <child>
-          <object class="GtkBox">
-            <property name="orientation">vertical</property>
-            <property name="spacing">12</property>
+          <object class="GtkStack" id="device_stack">
+            <property name="hhomogeneous">False</property>
+            <property name="vhomogeneous">False</property>
             <child>
-              <object class="GtkBox">
-                <child>
-                  <object class="GtkLabel" id="device_label">
-                    <property name="xalign">0</property>
-                    <property name="hexpand">True</property>
-                    <property name="label" translatable="yes">Devices</property>
+              <object class="GtkStackPage">
+                <property name="name">devices-page</property>
+                <property name="child">
+                  <object class="GtkListBox" id="device_list">
+                    <property name="selection-mode">none</property>
+                    <accessibility>
+                      <property name="label" translatable="yes">Devices</property>
+                    </accessibility>
                     <style>
-                      <class name="heading"/>
+                      <class name="boxed-list"/>
                     </style>
                   </object>
-                </child>
-                <child>
-                  <object class="GtkSpinner" id="device_spinner"/>
-                </child>
+                </property>
               </object>
             </child>
             <child>
-              <object class="GtkStack" id="device_stack">
-                <property name="hhomogeneous">False</property>
-                <property name="vhomogeneous">False</property>
-                <child>
-                  <object class="GtkStackPage">
-                    <property name="name">filler-page</property>
-                    <property name="child">
-                      <object class="GtkLabel">
-                        <property name="label" translatable="yes">Searching for devices…</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                    </property>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkStackPage">
-                    <property name="name">devices-page</property>
-                    <property name="child">
-                      <object class="GtkListBox" id="device_list">
-                        <property name="selection-mode">none</property>
-                        <accessibility>
-                          <relation name="labelled-by">device_label</relation>
-                        </accessibility>
-                        <style>
-                          <class name="boxed-list"/>
-                        </style>
-                      </object>
-                    </property>
+              <object class="GtkStackPage">
+                <property name="name">filler-page</property>
+                <property name="child">
+                  <object class="GtkLabel">
+                    <property name="label" translatable="yes">Searching for devices…</property>
+                    <style>
+                      <class name="dim-label"/>
+                    </style>
                   </object>
-                </child>
+                </property>
               </object>
             </child>
           </object>
diff --git a/meson.build b/meson.build
index 6bead6d0..d43822d5 100644
--- a/meson.build
+++ b/meson.build
@@ -99,7 +99,7 @@ gio_dep = dependency('gio-2.0', version: '>= 2.44')
 gio_unix_dep = dependency('gio-unix-2.0')
 gtk_dep = dependency('gtk4', version: '>= 4.4')
 gsound_dep = dependency('gsound')
-libadwaita_dep = dependency('libadwaita-1')
+libadwaita_dep = dependency('libadwaita-1', version: '>= 1.1')
 libnotify_dep = dependency('libnotify', version: '>= 0.7.0')
 libudev_dep = dependency('libudev')
 


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