mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
added keybinding (ctrl + l) to show lyrics
This commit is contained in:
parent
f13884d059
commit
03bc243f14
@ -1864,6 +1864,10 @@ class CoverLyricsOSD(Gtk.Overlay):
|
|||||||
self.client.emitter.connect("disconnected", self.on_disconnected)
|
self.client.emitter.connect("disconnected", self.on_disconnected)
|
||||||
self.client.emitter.connect("reconnected", self.on_reconnected)
|
self.client.emitter.connect("reconnected", self.on_reconnected)
|
||||||
|
|
||||||
|
def show_lyrics(self, *args):
|
||||||
|
if self.lyrics_button.get_sensitive():
|
||||||
|
self.lyrics_button.emit("clicked")
|
||||||
|
|
||||||
def on_reconnected(self, *args):
|
def on_reconnected(self, *args):
|
||||||
self.lyrics_button.set_sensitive(True)
|
self.lyrics_button.set_sensitive(True)
|
||||||
|
|
||||||
@ -1977,6 +1981,9 @@ class Browser(Gtk.Box):
|
|||||||
def search_started(self):
|
def search_started(self):
|
||||||
return self.search.started()
|
return self.search.started()
|
||||||
|
|
||||||
|
def show_lyrics(self, *args):
|
||||||
|
self.cover.show_lyrics()
|
||||||
|
|
||||||
def back_to_album(self, *args):
|
def back_to_album(self, *args):
|
||||||
try: #since this can still be running when the connection is lost, various exceptions can occur
|
try: #since this can still be running when the connection is lost, various exceptions can occur
|
||||||
song=ClientHelper.song_to_first_str_dict(self.client.currentsong())
|
song=ClientHelper.song_to_first_str_dict(self.client.currentsong())
|
||||||
@ -3346,6 +3353,11 @@ class MainWindow(Gtk.ApplicationWindow):
|
|||||||
self.play_opts.set_sensitive(False)
|
self.play_opts.set_sensitive(False)
|
||||||
|
|
||||||
def on_key_press_event(self, widget, event):
|
def on_key_press_event(self, widget, event):
|
||||||
|
ctrl = (event.state & Gdk.ModifierType.CONTROL_MASK)
|
||||||
|
if ctrl:
|
||||||
|
if event.keyval == 108: #ctrl + l
|
||||||
|
self.browser.show_lyrics()
|
||||||
|
else:
|
||||||
if event.keyval == 32: #space
|
if event.keyval == 32: #space
|
||||||
if not self.browser.search_started():
|
if not self.browser.search_started():
|
||||||
self.control.play_button.grab_focus()
|
self.control.play_button.grab_focus()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user