Advertisement
Guest User

rhythmbox-tray-icon/play.pause.patch

a guest
Jan 13th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. diff --git a/tray_icon.py b/tray_icon.py
  2. index 4de51af..ca45841 100644
  3. --- a/tray_icon.py
  4. +++ b/tray_icon.py
  5. @@ -1,9 +1,8 @@
  6. from gi.repository import Gtk, Gdk, GdkPixbuf, Peas, GObject
  7. import cairo
  8.  
  9. -iconsPath = "/usr/share/icons/"
  10. -rhythmboxIcon = iconsPath + "hicolor/32x32/apps/rhythmbox.png"
  11. -playIcon = iconsPath + "gnome/32x32/actions/media-playback-start.png"
  12. +rhythmboxIcon = "/usr/share/icons/hicolor/32x32/apps/rhythmbox.png"
  13. +playIcon = "/usr/share/pixmaps/rhythmbox-small.xpm"
  14.  
  15. class TrayIcon(GObject.Object, Peas.Activatable):
  16.  
  17. @@ -70,14 +69,9 @@ class TrayIcon(GObject.Object, Peas.Activatable):
  18. ui.insert_action_group(ag)
  19. self.popup = ui.get_widget("/PopupMenu")
  20.  
  21. - s1 = cairo.ImageSurface.create_from_png(rhythmboxIcon)
  22. - s2 = cairo.ImageSurface.create_from_png(playIcon)
  23. - ctx = cairo.Context(s1)
  24. - ctx.set_source_surface(s2, 0, 0)
  25. - ctx.paint()
  26. - self.playIcon = Gdk.pixbuf_get_from_surface(s1, 0, 0, s1.get_width(), s1.get_height())
  27. -
  28. self.normalIcon = GdkPixbuf.Pixbuf.new_from_file(rhythmboxIcon)
  29. + self.playIcon = GdkPixbuf.Pixbuf.new_from_file(playIcon)
  30. +
  31. self.icon = Gtk.StatusIcon.new_from_pixbuf(self.normalIcon)
  32. self.icon.connect("popup-menu", self.popup_menu)
  33. self.icon.connect("button-press-event", self.toggle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement