[gnome-music/wip/jfelder/gtk4-v3: 7/174] Switch from libhandy to libadwaita




commit 2fd12a14c626f90ca380e49167d68686ef38cbbc
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat May 22 22:42:15 2021 +0200

    Switch from libhandy to libadwaita

 data/ui/AlbumWidget.ui                   | 219 ++++++++++++++++---------------
 data/ui/ArtistAlbumsWidget.ui            |   2 +-
 data/ui/EmptyView.ui                     |   2 +-
 data/ui/HeaderBar.ui                     | 184 +++++++++++++-------------
 data/ui/PlayerToolbar.ui                 |   2 +-
 data/ui/PlaylistsWidget.ui               |   5 +-
 data/ui/SearchHeaderBar.ui               | 120 +++++++++--------
 data/ui/SearchView.ui                    |   4 +-
 data/ui/Window.ui                        |   2 +-
 gnome-music.in                           |   6 +-
 gnomemusic/application.py                |   6 +-
 gnomemusic/defaulticon.py                |   4 +-
 gnomemusic/views/emptyview.py            |   8 +-
 gnomemusic/widgets/albumwidget.py        |   4 +-
 gnomemusic/widgets/artistalbumswidget.py |   4 +-
 gnomemusic/widgets/artstack.py           |   6 +-
 gnomemusic/widgets/headerbar.py          |   9 +-
 gnomemusic/widgets/searchheaderbar.py    |   4 +-
 gnomemusic/window.py                     |  10 +-
 meson.build                              |   2 +-
 20 files changed, 308 insertions(+), 295 deletions(-)
---
diff --git a/data/ui/AlbumWidget.ui b/data/ui/AlbumWidget.ui
index 0b4388a89..4c090857f 100644
--- a/data/ui/AlbumWidget.ui
+++ b/data/ui/AlbumWidget.ui
@@ -2,145 +2,150 @@
 <!-- Generated with glade 3.20.0 -->
 <interface>
   <requires lib="gtk+" version="3.12"/>
-  <template class="AlbumWidget" parent="HdyClamp">
-    <property name="margin-bottom">48</property>
-    <property name="margin-top">48</property>
-    <property name="maximum-size">1000</property>
-    <property name="orientation">horizontal</property>
-    <property name="visible">True</property>
+  <template class="AlbumWidget" parent="GtkBox">
+    <property name="orientation">vertical</property>
     <child>
-      <object class="GtkBox">
-        <property name="halign">fill</property>
-        <property name="orientation">vertical</property>
+      <object class="AdwClamp">
+        <property name="margin-bottom">48</property>
+        <property name="margin-top">48</property>
+        <property name="maximum-size">1000</property>
+        <property name="orientation">horizontal</property>
         <property name="visible">True</property>
         <child>
-          <object class="GtkBox" id="albumInfo">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
+          <object class="GtkBox">
             <property name="halign">fill</property>
-            <property name="hexpand">True</property>
-            <property name="spacing">32</property>
-            <child>
-              <object class="ArtStack" id="_art_stack">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="halign">center</property>
-                <property name="valign">start</property>
-                <property name="hhomogeneous">False</property>
-                <property name="vhomogeneous">False</property>
-              </object>
-            </child>
+            <property name="orientation">vertical</property>
+            <property name="visible">True</property>
             <child>
-              <object class="GtkBox" id="albumDetails">
+              <object class="GtkBox" id="albumInfo">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="halign">center</property>
-                <property name="valign">start</property>
-                <property name="orientation">vertical</property>
-                <property name="margin-top">18</property>
-                <child>
-                  <object class="GtkLabel" id="_title_label">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">start</property>
-                    <property name="ellipsize">middle</property>
-                    <property name="margin-bottom">18</property>
-                    <style>
-                      <class name="title-1"/>
-                    </style>
-                  </object>
-                </child>
+                <property name="halign">fill</property>
+                <property name="hexpand">True</property>
+                <property name="spacing">32</property>
                 <child>
-                  <object class="GtkLabel" id="_artist_label">
+                  <object class="ArtStack" id="_art_stack">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="halign">start</property>
-                    <property name="ellipsize">middle</property>
-                    <property name="margin-bottom">12</property>
-                    <style>
-                      <class name="title-3"/>
-                    </style>
+                    <property name="halign">center</property>
+                    <property name="valign">start</property>
+                    <property name="hhomogeneous">False</property>
+                    <property name="vhomogeneous">False</property>
                   </object>
                 </child>
                 <child>
-                  <object class="GtkLabel" id="_released_label">
+                  <object class="GtkBox" id="albumDetails">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="halign">start</property>
-                    <property name="use_markup">True</property>
-                    <property name="margin-bottom">12</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="_composer_label">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">start</property>
-                    <property name="ellipsize">end</property>
-                    <property name="margin-bottom">12</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkBox">
-                    <property name="orientation">horizontal</property>
-                    <property name="visible">True</property>
-                    <property name="spacing">12</property>
-                    <property name="margin-top">6</property>
+                    <property name="halign">center</property>
+                    <property name="valign">start</property>
+                    <property name="orientation">vertical</property>
+                    <property name="margin-top">18</property>
+                    <child>
+                      <object class="GtkLabel" id="_title_label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="ellipsize">middle</property>
+                        <property name="margin-bottom">18</property>
+                        <style>
+                          <class name="title-1"/>
+                        </style>
+                      </object>
+                    </child>
                     <child>
-                      <object class="GtkButton" id="_play_button">
-                        <property name="width-request">44</property>
-                        <property name="height-request">44</property>
+                      <object class="GtkLabel" id="_artist_label">
                         <property name="visible">True</property>
-                        <property name="can-focus">True</property>
-                        <property name="receives-default">True</property>
-                        <property name="image">_play_image</property>
-                        <property name="always_show_image">True</property>
-                        <property name="tooltip-text" translatable="yes">Play</property>
-                        <property name="valign">center</property>
-                        <signal name="clicked" handler="_on_play_button_clicked" swapped="no"/>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="ellipsize">middle</property>
+                        <property name="margin-bottom">12</property>
                         <style>
-                          <class name="circular"/>
+                          <class name="title-3"/>
                         </style>
                       </object>
                     </child>
                     <child>
-                      <object class="GtkMenuButton" id="_menu_button">
-                        <property name="width-request">44</property>
-                        <property name="height-request">44</property>
+                      <object class="GtkLabel" id="_released_label">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="can_focus">False</property>
                         <property name="halign">start</property>
-                        <property name="valign">center</property>
-                        <property name="focus_on_click">False</property>
-                        <property name="menu-model">album_menu</property>
-                        <property name="direction">none</property>
-                        <property name="use_popover">True</property>
-                        <property name="image">_view_more_image</property>
+                        <property name="use_markup">True</property>
+                        <property name="margin-bottom">12</property>
                         <style>
-                          <class name="image-button"/>
-                          <class name="circular"/>
+                          <class name="dim-label"/>
                         </style>
                       </object>
                     </child>
+                    <child>
+                      <object class="GtkLabel" id="_composer_label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="ellipsize">end</property>
+                        <property name="margin-bottom">12</property>
+                        <style>
+                          <class name="dim-label"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="orientation">horizontal</property>
+                        <property name="visible">True</property>
+                        <property name="spacing">12</property>
+                        <property name="margin-top">6</property>
+                        <child>
+                          <object class="GtkButton" id="_play_button">
+                            <property name="width-request">44</property>
+                            <property name="height-request">44</property>
+                            <property name="visible">True</property>
+                            <property name="can-focus">True</property>
+                            <property name="receives-default">True</property>
+                            <property name="image">_play_image</property>
+                            <property name="always_show_image">True</property>
+                            <property name="tooltip-text" translatable="yes">Play</property>
+                            <property name="valign">center</property>
+                            <signal name="clicked" handler="_on_play_button_clicked" swapped="no"/>
+                            <style>
+                              <class name="circular"/>
+                            </style>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkMenuButton" id="_menu_button">
+                            <property name="width-request">44</property>
+                            <property name="height-request">44</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="halign">start</property>
+                            <property name="valign">center</property>
+                            <property name="focus_on_click">False</property>
+                            <property name="menu-model">album_menu</property>
+                            <property name="direction">none</property>
+                            <property name="use_popover">True</property>
+                            <property name="image">_view_more_image</property>
+                            <style>
+                              <class name="image-button"/>
+                              <class name="circular"/>
+                            </style>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
             </child>
-          </object>
-        </child>
-        <child>
-          <object class="GtkListBox" id="_disc_list_box">
-            <property name="can_focus">False</property>
-            <property name="margin-top">48</property>
-            <property name="selection_mode">0</property>
-            <property name="visible">True</property>
+            <child>
+              <object class="GtkListBox" id="_disc_list_box">
+                <property name="can_focus">False</property>
+                <property name="margin-top">48</property>
+                <property name="selection_mode">0</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
           </object>
         </child>
       </object>
diff --git a/data/ui/ArtistAlbumsWidget.ui b/data/ui/ArtistAlbumsWidget.ui
index ae6a4cf54..eb7fe0032 100644
--- a/data/ui/ArtistAlbumsWidget.ui
+++ b/data/ui/ArtistAlbumsWidget.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.18"/>
-  <template class="ArtistAlbumsWidget" parent="HdyClamp">
+  <template class="ArtistAlbumsWidget" parent="AdwClamp">
     <property name="maximum-size">1000</property>
     <property name="orientation">horizontal</property>
     <property name="visible">True</property>
diff --git a/data/ui/EmptyView.ui b/data/ui/EmptyView.ui
index 61b748997..e39c48a82 100644
--- a/data/ui/EmptyView.ui
+++ b/data/ui/EmptyView.ui
@@ -5,7 +5,7 @@
     <property name="transition_type">crossfade</property>
     <property name="visible">False</property>
     <child>
-      <object class="HdyStatusPage" id="_status_page">
+      <object class="AdwStatusPage" id="_status_page">
         <property name="visible">True</property>
         <property name="hexpand">True</property>
         <property name="vexpand">True</property>
diff --git a/data/ui/HeaderBar.ui b/data/ui/HeaderBar.ui
index 4ffd0db56..9e46b7036 100644
--- a/data/ui/HeaderBar.ui
+++ b/data/ui/HeaderBar.ui
@@ -1,121 +1,125 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.10 -->
-  <template class="HeaderBar" parent="HdyHeaderBar">
-    <property name="visible">True</property>
-    <property name="vexpand">False</property>
-    <style>
-      <class name="titlebar"/>
-    </style>
+  <template class="HeaderBar" parent="AdwBin">
     <child>
-      <object class="GtkMenuButton" id="_menu_button">
+      <object class="AdwHeaderBar">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <property name="tooltip_text" translatable="yes">Menu</property>
+        <property name="vexpand">False</property>
         <style>
-          <class name="image-button"/>
+          <class name="titlebar"/>
         </style>
         <child>
-          <object class="GtkImage" id="_menu_button_image">
+          <object class="GtkMenuButton" id="_menu_button">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="icon-name">open-menu-symbolic</property>
-            <property name="icon-size">1</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <property name="tooltip_text" translatable="yes">Menu</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="_menu_button_image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">open-menu-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
         </child>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkToggleButton" id="_select_button">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <property name="tooltip_text" translatable="yes">Select</property>
-        <style>
-          <class name="image-button"/>
-        </style>
         <child>
-          <object class="GtkImage" id="_select_button_image">
+          <object class="GtkToggleButton" id="_select_button">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="icon-name">object-select-symbolic</property>
-            <property name="icon-size">1</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <property name="tooltip_text" translatable="yes">Select</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="_select_button_image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">object-select-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="_cancel_button">
+            <property name="visible">False</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">_Cancel</property>
+            <property name="use_underline">True</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <signal name="clicked" handler="_on_cancel_button_clicked" swapped="no"/>
+            <style>
+              <class name="text-button"/>
+            </style>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
         </child>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkButton" id="_cancel_button">
-        <property name="visible">False</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">_Cancel</property>
-        <property name="use_underline">True</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <signal name="clicked" handler="_on_cancel_button_clicked" swapped="no"/>
-        <style>
-          <class name="text-button"/>
-        </style>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkToggleButton" id="_search_button">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <property name="tooltip_text" translatable="yes">Search</property>
-        <style>
-          <class name="image-button"/>
-        </style>
         <child>
-          <object class="GtkImage" id="_search_button_image">
+          <object class="GtkToggleButton" id="_search_button">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="icon-name">edit-find-symbolic</property>
-            <property name="icon-size">1</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <property name="tooltip_text" translatable="yes">Search</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="_search_button_image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">edit-find-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
         </child>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkButton" id="_back_button">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <property name="tooltip_text" translatable="yes">Back</property>
-        <signal name="clicked" handler="_on_back_button_clicked" swapped="no"/>
-        <style>
-          <class name="image-button"/>
-        </style>
         <child>
-          <object class="GtkImage" id="_back_button_image">
+          <object class="GtkButton" id="_back_button">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="icon-name">go-previous-symbolic</property>
-            <property name="icon-size">1</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <property name="tooltip_text" translatable="yes">Back</property>
+            <signal name="clicked" handler="_on_back_button_clicked" swapped="no"/>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="_back_button_image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">go-previous-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="pack_type">start</property>
+          </packing>
         </child>
       </object>
-      <packing>
-        <property name="pack_type">start</property>
-      </packing>
     </child>
   </template>
   <object class="GtkSizeGroup" id="size1">
diff --git a/data/ui/PlayerToolbar.ui b/data/ui/PlayerToolbar.ui
index 3742d8957..f67fbae81 100644
--- a/data/ui/PlayerToolbar.ui
+++ b/data/ui/PlayerToolbar.ui
@@ -156,7 +156,7 @@
           </object>
         </child>
         <child>
-          <object class="HdyClamp">
+          <object class="AdwClamp">
             <property name="maximum-size">1000</property>
             <property name="visible">True</property>
             <child>
diff --git a/data/ui/PlaylistsWidget.ui b/data/ui/PlaylistsWidget.ui
index 721e89b55..0f3ce6189 100644
--- a/data/ui/PlaylistsWidget.ui
+++ b/data/ui/PlaylistsWidget.ui
@@ -4,7 +4,7 @@
     <property name="orientation">vertical</property>
     <property name="visible">True</property>
     <child>
-      <object class="HdyClamp">
+      <object class="AdwClamp">
         <property name="maximum-size">1000</property>
         <property name="visible">True</property>
         <child>
@@ -19,9 +19,10 @@
         <property name="vexpand">True</property>
         <property name="visible">True</property>
         <child>
-          <object class="HdyClamp">
+          <object class="AdwClamp">
             <property name="maximum-size">1000</property>
             <property name="visible">True</property>
+            <property name="valign">start</property>
             <child>
               <object class="GtkListBox" id="_songs_list">
                 <property name="margin-bottom">20</property>
diff --git a/data/ui/SearchHeaderBar.ui b/data/ui/SearchHeaderBar.ui
index 37c70b669..ecead5017 100644
--- a/data/ui/SearchHeaderBar.ui
+++ b/data/ui/SearchHeaderBar.ui
@@ -1,81 +1,85 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.10 -->
-  <template class="SearchHeaderBar" parent="HdyHeaderBar">
-    <property name="visible">True</property>
-    <property name="vexpand">False</property>
-    <style>
-      <class name="titlebar"/>
-    </style>
+  <template class="SearchHeaderBar" parent="AdwBin">
     <child>
-      <object class="GtkToggleButton" id="_select_button">
+      <object class="AdwHeaderBar">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <property name="tooltip_text" translatable="yes">Select</property>
+        <property name="vexpand">False</property>
         <style>
-          <class name="image-button"/>
+          <class name="titlebar"/>
         </style>
         <child>
-          <object class="GtkImage" id="_select_button_image">
+          <object class="GtkToggleButton" id="_select_button">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="icon-name">object-select-symbolic</property>
-            <property name="icon-size">1</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <property name="tooltip_text" translatable="yes">Select</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="_select_button_image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">object-select-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="_cancel_button">
+            <property name="visible">False</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">_Cancel</property>
+            <property name="use_underline">True</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <signal name="clicked" handler="_on_cancel_button_clicked" swapped="no"/>
+            <style>
+              <class name="text-button"/>
+            </style>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
         </child>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkButton" id="_cancel_button">
-        <property name="visible">False</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">_Cancel</property>
-        <property name="use_underline">True</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <signal name="clicked" handler="_on_cancel_button_clicked" swapped="no"/>
-        <style>
-          <class name="text-button"/>
-        </style>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkToggleButton" id="_search_button">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="valign">center</property>
-        <property name="sensitive">True</property>
-        <property name="tooltip_text" translatable="yes">Search</property>
-        <style>
-          <class name="image-button"/>
-        </style>
         <child>
-          <object class="GtkImage" id="_search_button_image">
+          <object class="GtkToggleButton" id="_search_button">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="icon-name">edit-find-symbolic</property>
-            <property name="icon-size">1</property>
+            <property name="valign">center</property>
+            <property name="sensitive">True</property>
+            <property name="tooltip_text" translatable="yes">Search</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="_search_button_image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">edit-find-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
         </child>
       </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
     </child>
   </template>
   <object class="GtkSizeGroup" id="size1">
-      <property name="mode">vertical</property>
-      <widgets>
-        <widget name="_search_button"/>
-        <widget name="_cancel_button"/>
-      </widgets>
+    <property name="mode">vertical</property>
+    <widgets>
+      <widget name="_search_button"/>
+      <widget name="_cancel_button"/>
+    </widgets>
   </object>
 </interface>
diff --git a/data/ui/SearchView.ui b/data/ui/SearchView.ui
index d7dc09dd1..de3a6f260 100644
--- a/data/ui/SearchView.ui
+++ b/data/ui/SearchView.ui
@@ -20,7 +20,7 @@
         <property name="vexpand">True</property>
         <property name="visible">True</property>
         <child>
-          <object class="HdyClamp">
+          <object class="AdwClamp">
             <property name="maximum-size">1600</property>
             <property name="visible">True</property>
             <child>
@@ -177,7 +177,7 @@
         <property name="vexpand">True</property>
         <property name="visible">True</property>
         <child>
-          <object class="HdyClamp">
+          <object class="AdwClamp">
             <property name="maximum-size">1600</property>
             <property name="visible">True</property>
             <child>
diff --git a/data/ui/Window.ui b/data/ui/Window.ui
index 276952595..91892b5d9 100644
--- a/data/ui/Window.ui
+++ b/data/ui/Window.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <template class="Window" parent="HdyApplicationWindow">
+  <template class="Window" parent="AdwApplicationWindow">
     <property name="default-height">500</property>
     <property name="default-width">300</property>
     <child>
diff --git a/gnome-music.in b/gnome-music.in
index d30a7ff0c..3cc186f00 100755
--- a/gnome-music.in
+++ b/gnome-music.in
@@ -40,14 +40,14 @@ if _LOCAL:
 
 import gi
 
+gi.require_version("Adw", "1")
 gi.require_version('Gtk', '4.0')
 gi.require_version('GIRepository', '2.0')
 gi.require_version('Gst', '1.0')
-gi.require_version("Handy", "1")
-from gi.repository import GIRepository, Gio, Gtk, Gst, Handy
+from gi.repository import Adw, GIRepository, Gio, Gtk, Gst
 
 Gst.init(None)
-Handy.init()
+Adw.init()
 
 LOCALE_DIR = '@localedir@'
 PKGDATA_DIR = '@pkgdatadir@'
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 341e8e1d5..f1edd91cb 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -33,7 +33,7 @@
 from typing import Optional
 from gettext import gettext as _
 
-from gi.repository import Gtk, Gio, GLib, Gdk, GObject, Handy
+from gi.repository import Adw, Gtk, Gio, GLib, Gdk, GObject
 
 from gnomemusic.coregrilo import CoreGrilo
 from gnomemusic.coremodel import CoreModel
@@ -234,8 +234,8 @@ class Application(Gtk.Application):
 
     def do_startup(self):
         Gtk.Application.do_startup(self)
-        Handy.StyleManager.get_default().set_color_scheme(
-            Handy.ColorScheme.PREFER_LIGHT)
+        Adw.StyleManager.get_default().set_color_scheme(
+            Adw.ColorScheme.PREFER_LIGHT)
         self._set_actions()
 
     def _quit(self, action=None, param=None):
diff --git a/gnomemusic/defaulticon.py b/gnomemusic/defaulticon.py
index b39ac60b7..18f429e99 100644
--- a/gnomemusic/defaulticon.py
+++ b/gnomemusic/defaulticon.py
@@ -28,7 +28,7 @@ from math import pi
 from typing import Dict, Tuple
 
 import cairo
-from gi.repository import Gtk, GObject, Gdk, Handy
+from gi.repository import Adw, Gtk, GObject, Gdk
 
 from gnomemusic.utils import ArtSize, DefaultIconType
 
@@ -143,7 +143,7 @@ class DefaultIcon(GObject.GObject):
         :return: The symbolic icon
         :rtype: cairo.ImageSurface
         """
-        dark = Handy.StyleManager.get_default().props.dark
+        dark = Adw.StyleManager.get_default().props.dark
         scale = self._widget.props.scale_factor
 
         if (icon_type, art_size, scale, dark) not in self._cache.keys():
diff --git a/gnomemusic/views/emptyview.py b/gnomemusic/views/emptyview.py
index 737dbc67d..9f27e9fab 100644
--- a/gnomemusic/views/emptyview.py
+++ b/gnomemusic/views/emptyview.py
@@ -76,10 +76,10 @@ class EmptyView(Gtk.Stack):
         folder_text = _("The contents of your {} will appear here.")
         self._content_text = folder_text.format(href_text)
 
-        # Hack to get to HdyClamp, so it can be hidden for the
+        # Hack to get to AdwClamp, so it can be hidden for the
         # initial state.
         child_of_child = self._status_page.get_child().get_child()
-        self._hdy_clamp = child_of_child.get_child().get_children()[0]
+        self._adw_clamp = child_of_child.get_child().get_children()[0]
 
         self._status_page.add(self._initial_state)
 
@@ -102,7 +102,7 @@ class EmptyView(Gtk.Stack):
         """
         self._state = value
 
-        self._hdy_clamp.props.visible = True
+        self._adw_clamp.props.visible = True
         self._initial_state.props.visible = False
 
         if self._state == EmptyView.State.EMPTY:
@@ -115,7 +115,7 @@ class EmptyView(Gtk.Stack):
             self._set_tracker_outdated_state()
 
     def _set_empty_state(self):
-        self._hdy_clamp.props.visible = False
+        self._adw_clamp.props.visible = False
         self._initial_state.props.visible = True
 
         self._description_label.props.label = self._content_text
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index c22b2f0a4..39219609c 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -27,7 +27,7 @@ from gettext import ngettext
 from typing import Optional, Union
 import typing
 
-from gi.repository import Gio, GLib, GObject, Gtk, Handy
+from gi.repository import Gio, GLib, GObject, Gtk
 
 from gnomemusic.corealbum import CoreAlbum
 from gnomemusic.utils import ArtSize, DefaultIconType
@@ -42,7 +42,7 @@ if typing.TYPE_CHECKING:
 
 
 @Gtk.Template(resource_path='/org/gnome/Music/ui/AlbumWidget.ui')
-class AlbumWidget(Handy.Clamp):
+class AlbumWidget(Gtk.Box):
     """Album widget.
 
     The album widget consists of an image with the album art
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index 4fce09c30..2f6d64dda 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/gnomemusic/widgets/artistalbumswidget.py
@@ -25,7 +25,7 @@
 from __future__ import annotations
 import typing
 
-from gi.repository import GObject, Gtk, Handy
+from gi.repository import Adw, GObject, Gtk
 
 from gnomemusic.widgets.albumwidget import AlbumWidget
 if typing.TYPE_CHECKING:
@@ -34,7 +34,7 @@ if typing.TYPE_CHECKING:
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/ArtistAlbumsWidget.ui")
-class ArtistAlbumsWidget(Handy.Clamp):
+class ArtistAlbumsWidget(Adw.Clamp):
     """Widget containing all albums by an artist
 
     A vertical list of AlbumWidget, containing all the albums
diff --git a/gnomemusic/widgets/artstack.py b/gnomemusic/widgets/artstack.py
index 2f805f2a4..96d8f520e 100644
--- a/gnomemusic/widgets/artstack.py
+++ b/gnomemusic/widgets/artstack.py
@@ -26,7 +26,7 @@ from __future__ import annotations
 from typing import Optional, Union
 import typing
 
-from gi.repository import GObject, Gtk, Handy
+from gi.repository import Adw, GObject, Gtk
 if typing.TYPE_CHECKING:
     from cairo import ImageSurface
 
@@ -82,7 +82,7 @@ class ArtStack(Gtk.Stack):
         self.props.size = size
 
         self.connect("destroy", self._on_destroy)
-        Handy.StyleManager.get_default().connect(
+        Adw.StyleManager.get_default().connect(
             "notify::dark", self._on_dark_changed)
 
     @GObject.Property(type=object, flags=GObject.ParamFlags.READWRITE)
@@ -143,7 +143,7 @@ class ArtStack(Gtk.Stack):
             self._on_thumbnail_changed(self._coreobject, None)
 
     def _on_dark_changed(
-            self, style_manager: Handy.StyleManager,
+            self, style_manager: Adw.StyleManager,
             pspec: GObject.ParamSpecBoolean) -> None:
         default_icon = DefaultIcon(self).get(self._art_type, self._size)
 
diff --git a/gnomemusic/widgets/headerbar.py b/gnomemusic/widgets/headerbar.py
index 8190638d4..27b28012c 100644
--- a/gnomemusic/widgets/headerbar.py
+++ b/gnomemusic/widgets/headerbar.py
@@ -25,7 +25,7 @@
 from enum import IntEnum
 
 from gettext import gettext as _, ngettext
-from gi.repository import GObject, Gtk, Handy
+from gi.repository import Adw, GObject, Gtk
 
 from gnomemusic.widgets.appmenu import AppMenu
 
@@ -72,7 +72,7 @@ class SelectionBarMenuButton(Gtk.MenuButton):
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/HeaderBar.ui")
-class HeaderBar(Handy.HeaderBar):
+class HeaderBar(Adw.Bin):
     """Headerbar of the application"""
 
     class State(IntEnum):
@@ -108,9 +108,8 @@ class HeaderBar(Handy.HeaderBar):
 
         self._selection_mode = False
 
-        self._stack_switcher = Handy.ViewSwitcher(
-            can_focus=False, halign="center")
-        self._stack_switcher.show()
+        self._stack_switcher = Adw.ViewSwitcher(
+            focusable=False, halign="center")
 
         self._selection_menu = SelectionBarMenuButton()
 
diff --git a/gnomemusic/widgets/searchheaderbar.py b/gnomemusic/widgets/searchheaderbar.py
index d5efaea55..4c8f10cea 100644
--- a/gnomemusic/widgets/searchheaderbar.py
+++ b/gnomemusic/widgets/searchheaderbar.py
@@ -24,14 +24,14 @@
 
 from enum import IntEnum
 
-from gi.repository import GLib, GObject, Gtk, Handy
+from gi.repository import Adw, GLib, GObject, Gtk
 
 from gnomemusic.search import Search
 from gnomemusic.widgets.headerbar import HeaderBar, SelectionBarMenuButton
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/SearchHeaderBar.ui")
-class SearchHeaderBar(Handy.HeaderBar):
+class SearchHeaderBar(Adw.Bin):
     """SearcnHeaderbar of the application"""
 
     class State(IntEnum):
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 578e84b8a..3a19653f8 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -24,7 +24,7 @@
 
 from typing import Optional
 
-from gi.repository import Gtk, Gdk, Gio, GLib, GObject, Handy
+from gi.repository import Adw, Gtk, Gdk, Gio, GLib, GObject
 from gettext import gettext as _
 
 from gnomemusic.gstplayer import Playback
@@ -48,7 +48,7 @@ from gnomemusic.widgets.selectiontoolbar import SelectionToolbar  # noqa: F401
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/Window.ui")
-class Window(Handy.ApplicationWindow):
+class Window(Adw.ApplicationWindow):
 
     __gtype_name__ = "Window"
 
@@ -252,9 +252,9 @@ class Window(Handy.ApplicationWindow):
             if isinstance(i, Gtk.Box):
                 continue
             if i.props.title:
-                self._stack.add_titled(i, i.props.name, i.props.title)
-                self._stack.child_set_property(
-                    i, "icon-name", i.props.icon_name)
+                stackpage = self._stack.add_titled(
+                    i, i.props.name, i.props.title)
+                stackpage.props.icon_name = i.props.icon_name
             else:
                 self._stack.add_named(i, i.props.name)
 
diff --git a/meson.build b/meson.build
index 980839121..b213d6194 100644
--- a/meson.build
+++ b/meson.build
@@ -45,7 +45,7 @@ dependency('glib-2.0', version: '>= 2.67.1')
 dependency('goa-1.0', version: '>= 3.35.90')
 dependency('gobject-introspection-1.0', version: '>= 1.35.0')
 dependency('gtk4', version: '>= 4.5.0')
-dependency('libhandy-1', version: '>= 1.5.0')
+dependency('libadwaita-1', version: '>= 1.0')
 dependency('libmediaart-2.0', version: '>= 1.9.1')
 dependency('libsoup-2.4')
 dependency('tracker-sparql-3.0', version: '>= 2.99.3')


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