Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/tray_icon.py b/tray_icon.py
- index 4de51af..ca45841 100644
- --- a/tray_icon.py
- +++ b/tray_icon.py
- @@ -1,9 +1,8 @@
- from gi.repository import Gtk, Gdk, GdkPixbuf, Peas, GObject
- import cairo
- -iconsPath = "/usr/share/icons/"
- -rhythmboxIcon = iconsPath + "hicolor/32x32/apps/rhythmbox.png"
- -playIcon = iconsPath + "gnome/32x32/actions/media-playback-start.png"
- +rhythmboxIcon = "/usr/share/icons/hicolor/32x32/apps/rhythmbox.png"
- +playIcon = "/usr/share/pixmaps/rhythmbox-small.xpm"
- class TrayIcon(GObject.Object, Peas.Activatable):
- @@ -70,14 +69,9 @@ class TrayIcon(GObject.Object, Peas.Activatable):
- 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.playIcon = GdkPixbuf.Pixbuf.new_from_file(playIcon)
- +
- self.icon = Gtk.StatusIcon.new_from_pixbuf(self.normalIcon)
- self.icon.connect("popup-menu", self.popup_menu)
- self.icon.connect("button-press-event", self.toggle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement