[gnome-music/wip/jfelder/sidebar-icons: 63/66] grltrackerplaylists: Add an icon_name property to playlists
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/sidebar-icons: 63/66] grltrackerplaylists: Add an icon_name property to playlists
- Date: Thu, 15 Apr 2021 13:19:53 +0000 (UTC)
commit 0dffcd8911e765b8da2699df4d0291936fa66de0
Author: Jean Felder <jfelder src gnome org>
Date: Thu Sep 12 22:44:00 2019 +0200
grltrackerplaylists: Add an icon_name property to playlists
This property will be used in the next commit to display an empty view
when a playlist is empty.
data/icons/playlist2-symbolic.svg | 6 ++++++
data/org.gnome.Music.gresource.xml | 1 +
gnomemusic/grilowrappers/grltrackerplaylists.py | 6 ++++++
3 files changed, 13 insertions(+)
---
diff --git a/data/icons/playlist2-symbolic.svg b/data/icons/playlist2-symbolic.svg
new file mode 100644
index 000000000..ed1ea2eb5
--- /dev/null
+++ b/data/icons/playlist2-symbolic.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
+ <g fill="#2e3436">
+ <path d="M3 3v2h10V3zm0 4v2h7.979V7zm0 4v2h5.01L8 11z"/>
+ <path d="M12 7v3.27a2 2 0 00-1-.27 2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2V9h2V7h-2z"/>
+ </g>
+</svg>
diff --git a/data/org.gnome.Music.gresource.xml b/data/org.gnome.Music.gresource.xml
index 4ef28690c..5566b2498 100644
--- a/data/org.gnome.Music.gresource.xml
+++ b/data/org.gnome.Music.gresource.xml
@@ -4,6 +4,7 @@
<file alias="gtk/help-overlay.ui" preprocess="xml-stripblanks">ui/help-overlay.ui</file>
<file>org.gnome.Music.css</file>
<file>icons/initial-state.png</file>
+ <file>icons/playlist2-symbolic.svg</file>
<file preprocess="xml-stripblanks">ui/AboutDialog.ui</file>
<file preprocess="xml-stripblanks">ui/AlbumCover.ui</file>
<file preprocess="xml-stripblanks">ui/AlbumWidget.ui</file>
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index 90a524b98..a129ba78c 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -282,6 +282,7 @@ class Playlist(GObject.GObject):
count = GObject.Property(type=int, default=0)
creation_date = GObject.Property(type=GLib.DateTime, default=None)
+ icon_name = GObject.Property(type=str, default="playlist2-symbolic")
is_smart = GObject.Property(type=bool, default=False)
pl_id = GObject.Property(type=str, default=None)
query = GObject.Property(type=str, default=None)
@@ -895,6 +896,7 @@ class MostPlayed(SmartPlaylist):
self.props.tag_text = "MOST_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Most Played")
+ self.props.icon_name = "audio-speakers-symbolic"
self.props.query = """
SELECT
%(media_type)s AS ?type
@@ -948,6 +950,7 @@ class NeverPlayed(SmartPlaylist):
self.props.tag_text = "NEVER_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Never Played")
+ self.props.icon_name = "dialog-question-symbolic"
self.props.query = """
SELECT
%(media_type)s AS ?type
@@ -1000,6 +1003,7 @@ class RecentlyPlayed(SmartPlaylist):
self.props.tag_text = "RECENTLY_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Recently Played")
+ self.props.icon_name = "document-open-recent-symbolic"
sparql_midnight_dateTime_format = "%Y-%m-%dT00:00:00Z"
days_difference = 7
@@ -1062,6 +1066,7 @@ class RecentlyAdded(SmartPlaylist):
self.props.tag_text = "RECENTLY_ADDED"
# TRANSLATORS: this is a playlist name
self._title = _("Recently Added")
+ self.props.icon_name = "list-add-symbolic"
sparql_midnight_dateTime_format = "%Y-%m-%dT00:00:00Z"
days_difference = 7
@@ -1124,6 +1129,7 @@ class Favorites(SmartPlaylist):
self.props.tag_text = "FAVORITES"
# TRANSLATORS: this is a playlist name
self._title = _("Favorite Songs")
+ self.props.icon_name = "starred-symbolic"
self.props.query = """
SELECT
%(media_type)s AS ?type
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]