[gnome-music/wip/jfelder/playlist-improvements: 3/5] playlistcontrols: Display the menu button below the headers




commit e1dc0bad59920c30b4cb0f0c92d9e6b118ebf722
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Jan 28 01:28:33 2021 +0100

    playlistcontrols: Display the menu button below the headers
    
    With this change, PlaylistControntrols does not need to be a GtkGrid
    anymore: it behaves as a grid with only one column. Thus, it can be a
    vertical GtkBox.
    
    Related: #438

 data/ui/PlaylistControls.ui            | 27 ++++++---------------------
 gnomemusic/widgets/playlistcontrols.py |  2 +-
 2 files changed, 7 insertions(+), 22 deletions(-)
---
diff --git a/data/ui/PlaylistControls.ui b/data/ui/PlaylistControls.ui
index 6402f548d..cec431c05 100644
--- a/data/ui/PlaylistControls.ui
+++ b/data/ui/PlaylistControls.ui
@@ -22,10 +22,11 @@
     <property name="icon_name">view-more-symbolic</property>
     <property name="icon_size">1</property>
   </object>
-  <template class="PlaylistControls" parent="GtkGrid">
+  <template class="PlaylistControls" parent="GtkBox">
+    <property name="orientation">vertical</property>
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="margin-bottom">18</property>
+    <property name="margin-bottom">0</property>
     <property name="margin-end">80</property>
     <property name="margin-start">80</property>
     <property name="margin-top">18</property>
@@ -86,12 +87,6 @@
           </packing>
         </child>
       </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">0</property>
-        <property name="width">1</property>
-        <property name="height">1</property>
-      </packing>
     </child>
     <child>
       <object class="GtkLabel" id="_songs_count_label">
@@ -103,36 +98,26 @@
           <class name="dim-label"/>
         </style>
       </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">1</property>
-        <property name="width">1</property>
-        <property name="height">1</property>
-      </packing>
     </child>
     <child>
       <object class="GtkMenuButton" id="_menubutton">
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">True</property>
-        <property name="halign">end</property>
+        <property name="halign">start</property>
         <property name="valign">center</property>
         <property name="focus_on_click">False</property>
         <property name="menu-model">playlistMenu</property>
         <property name="direction">none</property>
         <property name="use_popover">True</property>
         <property name="image">_view_more_image</property>
+        <property name="margin-bottom">8</property>
+        <property name="margin-top">18</property>
         <style>
           <class name="image-button"/>
           <class name="circular"/>
         </style>
       </object>
-      <packing>
-        <property name="left_attach">1</property>
-        <property name="top_attach">0</property>
-        <property name="width">1</property>
-        <property name="height">2</property>
-      </packing>
     </child>
   </template>
   <object class="GtkEventControllerKey" id="_rename_controller">
diff --git a/gnomemusic/widgets/playlistcontrols.py b/gnomemusic/widgets/playlistcontrols.py
index 9d5b9a821..3935edec4 100644
--- a/gnomemusic/widgets/playlistcontrols.py
+++ b/gnomemusic/widgets/playlistcontrols.py
@@ -31,7 +31,7 @@ from gnomemusic.widgets.notificationspopup import PlaylistNotification
 
 
 @Gtk.Template(resource_path='/org/gnome/Music/ui/PlaylistControls.ui')
-class PlaylistControls(Gtk.Grid):
+class PlaylistControls(Gtk.Box):
     """Widget holding the playlist controls"""
 
     __gtype_name__ = "PlaylistControls"


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