[gnome-music/wip/cdavis/hdywindow-hdyviewswitcher: 7/9] Use HdyApplicationWindow and HdyHeaderBar
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/cdavis/hdywindow-hdyviewswitcher: 7/9] Use HdyApplicationWindow and HdyHeaderBar
- Date: Mon, 12 Apr 2021 18:18:25 +0000 (UTC)
commit 02b916e7f6a8979d7482c3e3d7b55c749db67302
Author: Christopher Davis <brainblasted disroot org>
Date: Wed Feb 3 23:25:22 2021 -0800
Use HdyApplicationWindow and HdyHeaderBar
We need to use HdyApplicationWindow and HdyHeaderBar for
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 c0e8578a4..e44ee034c 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 fa2288edc..706b267d5 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 3e05a8664..4b6d6efdc 100644
--- a/gnomemusic/widgets/searchheaderbar.py
+++ b/gnomemusic/widgets/searchheaderbar.py
@@ -26,14 +26,14 @@ from enum import IntEnum
import gi
gi.require_version("Gd", "1.0")
-from gi.repository import GLib, GObject, Gd, Gtk
+from gi.repository import GLib, GObject, Gd, 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]