[gnome-music/wip/jfelder/appmenu-popover: 1/2] appmenu: Inherit from GtkPopover instead of GtkPopoverMenu
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/appmenu-popover: 1/2] appmenu: Inherit from GtkPopover instead of GtkPopoverMenu
- Date: Thu, 3 Feb 2022 00:58:13 +0000 (UTC)
commit febccbc292152986719396143e4ed185201327ce
Author: Jean Felder <jfelder src gnome org>
Date: Wed Feb 2 18:52:43 2022 +0100
appmenu: Inherit from GtkPopover instead of GtkPopoverMenu
In Gtk4, GtkPopoverMenu is meant to be used with a menu model.
The spacing and margins are updated accordingly to get the same layout
as GtkPopoverMenu.
data/ui/AppMenu.ui | 16 +++++++---------
gnomemusic/widgets/appmenu.py | 2 +-
2 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/data/ui/AppMenu.ui b/data/ui/AppMenu.ui
index 71ae356b9..781308dab 100644
--- a/data/ui/AppMenu.ui
+++ b/data/ui/AppMenu.ui
@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
- <template class="AppMenu" parent="GtkPopoverMenu">
+ <template class="AppMenu" parent="GtkPopover">
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
@@ -12,12 +12,13 @@
<property name="margin-end">6</property>
<property name="margin-start">6</property>
<property name="margin-top">6</property>
+ <property name="spacing">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkModelButton" id="lastfm_account_button">
<property name="can_focus">False</property>
<property name="halign">fill</property>
- <property name="hexpand">False</property>
+ <property name="hexpand">True</property>
<property name="visible">True</property>
<property name="action_name">app.lastfm-configure</property>
<property name="text" translatable="yes">Last.fm Account</property>
@@ -26,11 +27,11 @@
<child>
<object class="GtkBox" id="_lastfm_box">
<property name="margin-end">5</property>
- <property name="margin-start">5</property>
<property name="visible">False</property>
<child>
<object class="GtkLabel">
<property name="can_focus">False</property>
+ <property name="margin-start">5</property>
<property name="margin-end">12</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
@@ -55,7 +56,7 @@
<child>
<object class="GtkModelButton" id="_keyboard_shortcuts_model_button">
<property name="halign">fill</property>
- <property name="hexpand">False</property>
+ <property name="hexpand">True</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -66,7 +67,7 @@
<child>
<object class="GtkModelButton" id="_help_model_button">
<property name="halign">fill</property>
- <property name="hexpand">False</property>
+ <property name="hexpand">True</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -77,7 +78,7 @@
<child>
<object class="GtkModelButton" id="_about_model_button">
<property name="halign">fill</property>
- <property name="hexpand">False</property>
+ <property name="hexpand">True</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -86,9 +87,6 @@
</object>
</child>
</object>
- <packing>
- <property name="submenu">main</property>
- </packing>
</child>
</template>
</interface>
diff --git a/gnomemusic/widgets/appmenu.py b/gnomemusic/widgets/appmenu.py
index b14641626..c0baecb72 100644
--- a/gnomemusic/widgets/appmenu.py
+++ b/gnomemusic/widgets/appmenu.py
@@ -28,7 +28,7 @@ from gnomemusic.scrobbler import GoaLastFM
@Gtk.Template(resource_path="/org/gnome/Music/ui/AppMenu.ui")
-class AppMenu(Gtk.PopoverMenu):
+class AppMenu(Gtk.Popover):
"""AppMenu shown from the HeaderBar within the main view"""
__gtype_name__ = "AppMenu"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]