[gnome-music/wip/jfelder/fix-playlist-context-menu] songwidget: Fix PlaylistContextMenu usage




commit 7670cf4a040ac4a249873f251922b05c4def038a
Author: Jean Felder <jfelder src gnome org>
Date:   Sun May 9 16:53:02 2021 +0200

    songwidget: Fix PlaylistContextMenu usage
    
    With the recent SongWidget change to directly inherit from a
    GtkListBoxRow, the rows became not selectable in order to ensure that
    the play indicator stays visible when a row is activated. However,
    this broke PlaylistContextMenu usage because it relies on rows being
    selectable to work properly.
    
    This issue is fixed by making SongWidget selectable and adding a css
    rule to keep the play indicator visible when a SongWidget is
    selected.

 data/org.gnome.Music.css | 4 ++++
 data/ui/SongWidget.ui    | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/data/org.gnome.Music.css b/data/org.gnome.Music.css
index 4fa856bd6..dce3226ee 100644
--- a/data/org.gnome.Music.css
+++ b/data/org.gnome.Music.css
@@ -183,6 +183,10 @@ padding: 0px;
     border-bottom: none;
 }
 
+.songs-list > row:selected {
+    color: @theme_fg_color;
+}
+
 .playlistdialog-row:selected {
     color: @theme_fg_color;
     background-color: @theme_insensitive_bg_color;
diff --git a/data/ui/SongWidget.ui b/data/ui/SongWidget.ui
index e60ad30e6..ea6952c00 100644
--- a/data/ui/SongWidget.ui
+++ b/data/ui/SongWidget.ui
@@ -4,7 +4,6 @@
   <requires lib="gtk+" version="3.10"/>
   <template class="SongWidget" parent="GtkListBoxRow">
     <property name="visible">True</property>
-    <property name="selectable">False</property>
     <property name="can_focus">False</property>
     <signal name="drag_data_received" handler="_on_drag_data_received"/>
     <child>


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