[gnome-music/wip/jfelder/gtk4-v3: 101/259] appmenu: Inherit from GtkPopover instead of GtkPopoverMenu




commit ea4a57dd95eb6de12a946e3ca0a5a0f007d31aa2
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Feb 2 18:52:43 2022 +0100

    appmenu: Inherit from GtkPopover instead of GtkPopoverMenu
    
    GtkPopoverMenu is meant to be used with a menu model.
    
    Update the spacing and margin accordingly to get the same layout as
    GtkPopoverMenu.

 data/ui/AppMenu.ui            | 7 +++++--
 gnomemusic/widgets/appmenu.py | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/AppMenu.ui b/data/ui/AppMenu.ui
index 826a0c9eb..70f9e7f58 100644
--- a/data/ui/AppMenu.ui
+++ b/data/ui/AppMenu.ui
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <template class="AppMenu" parent="GtkPopoverMenu">
+  <template class="AppMenu" parent="GtkPopover">
     <property name="focusable">False</property>
+    <style>
+      <class name="menu"/>
+    </style>
     <child>
       <object class="GtkBox">
         <property name="focusable">False</property>
@@ -9,6 +12,7 @@
         <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">
@@ -22,7 +26,6 @@
         <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">
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]