Simplify tooltip
Although usage tips are handy and useful, they look clunky in the tooltip. They also lack localization and this project doesn't provide translations. Show artist and song name during playback and "Rhythmbox" the rest of the time.
Esse commit está contido em:
+4
-8
@@ -236,20 +236,16 @@ class TrayIcon(GObject.Object, Peas.Activatable):
|
|||||||
if playing:
|
if playing:
|
||||||
self.icon.set_from_file(self.play_icon)
|
self.icon.set_from_file(self.play_icon)
|
||||||
current_entry = self.shell.props.shell_player.get_playing_entry()
|
current_entry = self.shell.props.shell_player.get_playing_entry()
|
||||||
self.set_tooltip_text(current_entry.get_string(RB.RhythmDBPropType.ARTIST) + " - " + current_entry.get_string(RB.RhythmDBPropType.TITLE))
|
self.set_tooltip_text("%s\n%s" % (current_entry.get_string(RB.RhythmDBPropType.ARTIST), current_entry.get_string(RB.RhythmDBPropType.TITLE)))
|
||||||
else:
|
else:
|
||||||
self.icon.set_from_file(self.rhythmbox_icon)
|
self.icon.set_from_file(self.rhythmbox_icon)
|
||||||
self.set_tooltip_text()
|
self.set_tooltip_text("Rhythmbox")
|
||||||
|
|
||||||
def set_tooltip_text(self, message=""):
|
def set_tooltip_text(self, message=""):
|
||||||
"""
|
"""
|
||||||
Sets tooltip to given message
|
Sets tooltip to given message
|
||||||
"""
|
"""
|
||||||
prepend = ""
|
self.icon.set_tooltip_text(message)
|
||||||
if len(message) > 0:
|
|
||||||
prepend = "\r\n"
|
|
||||||
tooltip_text = message + prepend + "(Scroll = volume, click = visibility, middle click = next)"
|
|
||||||
self.icon.set_tooltip_text(tooltip_text)
|
|
||||||
|
|
||||||
def do_activate(self):
|
def do_activate(self):
|
||||||
"""
|
"""
|
||||||
@@ -271,7 +267,7 @@ class TrayIcon(GObject.Object, Peas.Activatable):
|
|||||||
self.icon.connect("button-press-event", self.toggle_player_visibility)
|
self.icon.connect("button-press-event", self.toggle_player_visibility)
|
||||||
self.player.connect("playing-changed", self.on_playing_changed)
|
self.player.connect("playing-changed", self.on_playing_changed)
|
||||||
|
|
||||||
self.set_tooltip_text()
|
self.set_tooltip_text("Rhythmbox")
|
||||||
|
|
||||||
def on_scroll(self, widget, event):
|
def on_scroll(self, widget, event):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário