Icons theming #10

Open
wants to merge 3 commits into
from

Projects

None yet

2 participants

@kalgasnik

Using icons names instead of absolute paths

@kalgasnik kalgasnik Icons theming
Using icons names instead of absolute paths
4711e24
@palfrey palfrey commented on the diff Jan 21, 2013
tray_icon.py
@@ -73,16 +72,8 @@ def do_activate(self):
])
ui.insert_action_group(ag)
self.popup = ui.get_widget("/PopupMenu")
-
- s1 = cairo.ImageSurface.create_from_png(rhythmboxIcon)
- s2 = cairo.ImageSurface.create_from_png(playIcon)
- ctx = cairo.Context(s1)
- ctx.set_source_surface(s2, 0, 0)
- ctx.paint()
- self.playIcon = Gdk.pixbuf_get_from_surface(s1, 0, 0, s1.get_width(), s1.get_height())
@palfrey
palfrey Jan 21, 2013

Removing this whole block results in an icon that's just a "play" symbol, not a "play + Rhythmbox" symbol, which is what I was going for.

@kalgasnik
kalgasnik Jan 23, 2013

Updated. Options dialog has been added: choosing icons/files and drawing mode.

@palfrey palfrey commented on an outdated diff Jan 21, 2013
@@ -73,16 +72,8 @@ def do_activate(self):
])
ui.insert_action_group(ag)
self.popup = ui.get_widget("/PopupMenu")
-
- s1 = cairo.ImageSurface.create_from_png(rhythmboxIcon)
- s2 = cairo.ImageSurface.create_from_png(playIcon)
- ctx = cairo.Context(s1)
- ctx.set_source_surface(s2, 0, 0)
- ctx.paint()
- self.playIcon = Gdk.pixbuf_get_from_surface(s1, 0, 0, s1.get_width(), s1.get_height())
-
- self.normalIcon = GdkPixbuf.Pixbuf.new_from_file(rhythmboxIcon)
- self.icon = Gtk.StatusIcon.new_from_pixbuf(self.normalIcon)
+
+ self.icon = Gtk.StatusIcon.new_from_icon_name(normalIconName)
@palfrey
palfrey Jan 21, 2013

This has more possibilities though. I'm interested in stuff that does things with themes, less so in anything that removes the merged icon look (well, unless you want to make a config bit that'll give it as a choice)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment