[gnome-music/wip/jfelder/smartplaylists-ui-v2: 6/12] 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: 6/12] playlist: Add a color property
- Date: Wed, 22 Jan 2020 00:01:04 +0000 (UTC)
commit 5b3421760bb29638148d1a940158377862c25bc9
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 acec7b2b..a99a3da5 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
@@ -708,6 +708,8 @@ class Playlist(GObject.GObject):
class SmartPlaylist(Playlist):
"""Base class for smart playlists"""
+ color = GObject.Property(type=Gdk.RGBA)
+
def __repr__(self):
return "<SmartPlaylist>"
@@ -756,6 +758,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)
@@ -793,6 +796,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)
@@ -829,6 +833,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
@@ -875,6 +880,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
@@ -920,6 +926,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]