[gnome-music: 1/5] Load default icon using Gtk.IconTheme
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music: 1/5] Load default icon using Gtk.IconTheme
- Date: Fri, 2 Aug 2013 11:06:52 +0000 (UTC)
commit ea5cc81534389ab1fc1fb5bb062b17f31dc1a5da
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Sun Jul 28 10:12:42 2013 +0800
Load default icon using Gtk.IconTheme
We are using an absolute path before, which doesn't take into account the
current theme and icon path.
gnomemusic/albumArtCache.py | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/gnomemusic/albumArtCache.py b/gnomemusic/albumArtCache.py
index 41b2f53..8f7d15b 100644
--- a/gnomemusic/albumArtCache.py
+++ b/gnomemusic/albumArtCache.py
@@ -1,4 +1,4 @@
-from gi.repository import GdkPixbuf, Gio, GLib, Grl, Gdk
+from gi.repository import Gtk, GdkPixbuf, Gio, GLib, Grl, Gdk
from gettext import gettext as _
import cairo
from math import pi
@@ -66,14 +66,8 @@ class AlbumArtCache:
pass
def make_default_icon(self, width, height):
- path =\
- "/usr/share/icons/gnome/scalable/places/folder-music-symbolic.svg"
# get a small pixbuf with the given path
- icon = GdkPixbuf.Pixbuf.new_from_file_at_scale(
- path,
- -1 if width < 0 else width / 4,
- -1 if height < 0 else height / 4,
- True)
+ icon = Gtk.IconTheme.get_default().load_icon('folder-music-symbolic', max(width, height) / 4, 0)
# create an empty pixbuf with the requested size
result = GdkPixbuf.Pixbuf.new(icon.get_colorspace(),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]