[gnome-music/wip/cdavis/hdywindow-hdyviewswitcher: 36/38] Use HdyApplicationWindow and HdyHeaderBar




commit b15c19e565d575442c7fa6c8a897870942e40ad6
Author: Christopher Davis <brainblasted disroot org>
Date:   Wed Feb 3 23:25:22 2021 -0800

    Use HdyApplicationWindow and HdyHeaderBar
    
    HdyApplicationWindow and HdyHeaderBar are used to have rounded
    corners, which GNOME is moving to use in GNOME 40.

 data/ui/HeaderBar.ui                  |  2 +-
 data/ui/SearchHeaderBar.ui            |  2 +-
 data/ui/Window.ui                     | 14 +++++++-------
 gnomemusic/widgets/headerbar.py       |  2 +-
 gnomemusic/widgets/searchheaderbar.py |  4 ++--
 gnomemusic/window.py                  |  4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/data/ui/HeaderBar.ui b/data/ui/HeaderBar.ui
index e1508d32c..4ffd0db56 100644
--- a/data/ui/HeaderBar.ui
+++ b/data/ui/HeaderBar.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.10 -->
-  <template class="HeaderBar" parent="GtkHeaderBar">
+  <template class="HeaderBar" parent="HdyHeaderBar">
     <property name="visible">True</property>
     <property name="vexpand">False</property>
     <style>
diff --git a/data/ui/SearchHeaderBar.ui b/data/ui/SearchHeaderBar.ui
index 48bd0795e..37c70b669 100644
--- a/data/ui/SearchHeaderBar.ui
+++ b/data/ui/SearchHeaderBar.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.10 -->
-  <template class="SearchHeaderBar" parent="GtkHeaderBar">
+  <template class="SearchHeaderBar" parent="HdyHeaderBar">
     <property name="visible">True</property>
     <property name="vexpand">False</property>
     <style>
diff --git a/data/ui/Window.ui b/data/ui/Window.ui
index c2b0032e9..365a44fc0 100644
--- a/data/ui/Window.ui
+++ b/data/ui/Window.ui
@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <template class="Window" parent="GtkApplicationWindow">
+  <template class="Window" parent="HdyApplicationWindow">
     <property name="default-height">500</property>
     <property name="default-width">300</property>
-    <child type="titlebar">
-      <object class="GtkStack" id="_headerbar_stack">
-        <property name="transition-type">crossfade</property>
-        <property name="visible">True</property>
-      </object>
-    </child>
     <child>
       <object class="GtkBox">
         <property name="orientation">vertical</property>
         <property name="visible">True</property>
+        <child>
+          <object class="GtkStack" id="_headerbar_stack">
+            <property name="transition-type">crossfade</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
         <child>
           <object class="GtkOverlay" id="_overlay">
             <property name="vexpand">True</property>
diff --git a/gnomemusic/widgets/headerbar.py b/gnomemusic/widgets/headerbar.py
index 37b98eeda..8190638d4 100644
--- a/gnomemusic/widgets/headerbar.py
+++ b/gnomemusic/widgets/headerbar.py
@@ -72,7 +72,7 @@ class SelectionBarMenuButton(Gtk.MenuButton):
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/HeaderBar.ui")
-class HeaderBar(Gtk.HeaderBar):
+class HeaderBar(Handy.HeaderBar):
     """Headerbar of the application"""
 
     class State(IntEnum):
diff --git a/gnomemusic/widgets/searchheaderbar.py b/gnomemusic/widgets/searchheaderbar.py
index 09330a109..d5efaea55 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
+from gi.repository import GLib, GObject, Gtk, Handy
 
 from gnomemusic.search import Search
 from gnomemusic.widgets.headerbar import HeaderBar, SelectionBarMenuButton
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/SearchHeaderBar.ui")
-class SearchHeaderBar(Gtk.HeaderBar):
+class SearchHeaderBar(Handy.HeaderBar):
     """SearcnHeaderbar of the application"""
 
     class State(IntEnum):
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index fcfa038f2..dfeb8fef0 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -22,7 +22,7 @@
 # code, but you are not obligated to do so.  If you do not wish to do so,
 # delete this exception statement from your version.
 
-from gi.repository import Gtk, Gdk, Gio, GLib, GObject
+from gi.repository import Gtk, Gdk, Gio, GLib, GObject, Handy
 from gettext import gettext as _
 
 from gnomemusic.gstplayer import Playback
@@ -47,7 +47,7 @@ from gnomemusic.windowplacement import WindowPlacement
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/Window.ui")
-class Window(Gtk.ApplicationWindow):
+class Window(Handy.ApplicationWindow):
 
     __gtype_name__ = "Window"
 


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