Permalink
Browse files

Merge remote branch 'st4nny/master', amending whitespace

Conflicts:
	tray_icon.py
  • Loading branch information...
2 parents 8a4a56b + 706a94f commit f23752064c0b0723fcf1f22229f6b2ca1d4e3355 @palfrey committed Apr 25, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 tray_icon.py
View
@@ -30,7 +30,7 @@ def nextItem(self, widget):
def previous(self, widget):
self.player.do_previous()
- def quit(self, widget):
+ def quit(self, widget):
self.shell.quit()
def hide_on_delete(self, widget, event):
@@ -83,10 +83,20 @@ def do_activate(self):
self.normalIcon = GdkPixbuf.Pixbuf.new_from_file(rhythmboxIcon)
self.icon = Gtk.StatusIcon.new_from_pixbuf(self.normalIcon)
+ self.icon.connect("scroll-event", self.scroll)
self.icon.connect("popup-menu", self.popup_menu)
self.icon.connect("button-press-event", self.toggle)
self.player.connect("playing-changed", self.set_playing_icon)
+ def scroll(self, widget, event):
+ if self.player.playpause(True):
+ # scroll up for previous track
+ if event.direction == Gdk.ScrollDirection.UP:
+ self.previous(widget)
+ # scroll down for next track
+ elif event.direction == Gdk.ScrollDirection.DOWN:
+ self.nextItem(widget)
+
def do_deactivate(self):
self.icon.set_visible(False)
del self.icon

0 comments on commit f237520

Please sign in to comment.