[gnome-music/wip/jfelder/smartplaylists-ui-v2: 23/29] playlist: Add a color property
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/smartplaylists-ui-v2: 23/29] playlist: Add a color property
- Date: Sat, 1 Feb 2020 16:24:06 +0000 (UTC)
commit cff98e5429fba9b4018f2ca3ad331836e162e4d1
Author: Jean Felder <jfelder src gnome org>
Date: Tue Sep 10 22:42:14 2019 +0200
playlist: Add a color property
This property will be used by the new smart playlists ui.
gnomemusic/grilowrappers/grltrackerplaylists.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index e968f188..d1707d89 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -29,7 +29,7 @@ from gettext import gettext as _
import gi
gi.require_versions({"Grl": "0.3"})
-from gi.repository import Gio, Grl, GLib, GObject
+from gi.repository import Gdk, Gio, Grl, GLib, GObject
from gnomemusic.coresong import CoreSong
from gnomemusic.trackerwrapper import TrackerWrapper
@@ -707,6 +707,8 @@ class Playlist(GObject.GObject):
class SmartPlaylist(Playlist):
"""Base class for smart playlists"""
+ color = GObject.Property(type=Gdk.RGBA)
+
def __repr__(self):
return "<SmartPlaylist>"
@@ -755,6 +757,7 @@ class MostPlayed(SmartPlaylist):
self.props.tag_text = "MOST_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Most Played")
+ self.props.color = Gdk.RGBA(0.96, 0.47, 0.0)
self.props.query = """
SELECT
rdf:type(?song)
@@ -792,6 +795,7 @@ class NeverPlayed(SmartPlaylist):
self.props.tag_text = "NEVER_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Never Played")
+ self.props.color = Gdk.RGBA(0.45, 0.62, 0.81)
self.props.query = """
SELECT
rdf:type(?song)
@@ -828,6 +832,7 @@ class RecentlyPlayed(SmartPlaylist):
self.props.tag_text = "RECENTLY_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Recently Played")
+ self.props.color = Gdk.RGBA(0.68, 0.50, 0.66)
sparql_midnight_dateTime_format = "%Y-%m-%dT00:00:00Z"
days_difference = 7
@@ -874,6 +879,7 @@ class RecentlyAdded(SmartPlaylist):
self.props.tag_text = "RECENTLY_ADDED"
# TRANSLATORS: this is a playlist name
self._title = _("Recently Added")
+ self.props.color = Gdk.RGBA(0.31, 0.60, 0.02)
sparql_midnight_dateTime_format = "%Y-%m-%dT00:00:00Z"
days_difference = 7
@@ -919,6 +925,7 @@ class Favorites(SmartPlaylist):
self.props.tag_text = "FAVORITES"
# TRANSLATORS: this is a playlist name
self._title = _("Favorite Songs")
+ self.props.color = Gdk.RGBA(0.93, 0.83, 0.0)
self.props.query = """
SELECT
rdf:type(?song)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]