tooltip #8

Open
wants to merge 1 commit into from

1 participant

@mg42

added two features:

  • the name of the current title and artist are displayed as a tool-tip when the mouse pointer hovers over the icon
  • a click with the middle mouse button (scroll wheel) toggles playing/pausing
@mg42 mg42 tooltip
added two features:

  * the name of the current title and artist are displayed as a
    tool-tip when the mouse pointer hovers over the icon
  * a click with the middle mouse button (scroll wheel) toggles
    playing/pausing
cc8e56b
@palfrey palfrey commented on the diff Jan 22, 2013
tray_icon.py
@@ -37,12 +39,42 @@ def hide_on_delete(self, widget, event):
self.wind.hide()
return True # don't actually delete
- def set_playing_icon(self, player, playing):
+ def playing_changed(self, player, song):
@palfrey
Owner
palfrey added a note Jan 22, 2013

This change (renaming playing -> song) breaks the line two down "if playing:"

@mg42
mg42 added a note Jan 23, 2013

hmm, I missed that one; either do "if song:" in line 44 or just leave the original "def set_playing_icon(self, player, playing):"
both should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@palfrey palfrey commented on the diff Jan 23, 2013
tray_icon.py
+ self.icon.set_tooltip_text(self.get_icon_title())
+
+ def playing_song_property_changed(self, player, uri, property, old, new):
+ self.icon.set_tooltip_text(self.get_icon_title())
+
+ def get_icon_title(self):
+ self.shell = self.object
+ self.player = self.shell.props.shell_player
+ self.song = self.player.get_playing_entry()
+ self.db = self.shell.get_property("db")
+ try:
+ self.current_title = self.song.get_string(RB.RhythmDBPropType.TITLE)
+ except AttributeError:
+ return "Not playing."
+ #no stream: titel + artist
+ #stream: stream_titel + titel
@palfrey
Owner
palfrey added a note Jan 23, 2013

Sorry to be picky about this, but "titel" should be "title"

@mg42
mg42 added a note Jan 23, 2013

must be my German breaking through;-)

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