mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
added seeking hot-keys
This commit is contained in:
parent
d909f351d3
commit
ac53fc2136
@ -1429,17 +1429,23 @@ class SeekBar(Gtk.Box):
|
|||||||
pos=(duration*factor)
|
pos=(duration*factor)
|
||||||
self.client.seekcur(pos)
|
self.client.seekcur(pos)
|
||||||
|
|
||||||
|
def seek_forward(self):
|
||||||
|
self.client.seekcur("+"+self.seek_time)
|
||||||
|
|
||||||
|
def seek_backward(self):
|
||||||
|
self.client.seekcur("-"+self.seek_time)
|
||||||
|
|
||||||
def on_elapsed_button_press_event(self, widget, event):
|
def on_elapsed_button_press_event(self, widget, event):
|
||||||
if event.button == 1:
|
if event.button == 1:
|
||||||
self.client.seekcur("-"+self.seek_time)
|
self.seek_backward()
|
||||||
elif event.button == 3:
|
elif event.button == 3:
|
||||||
self.client.seekcur("+"+self.seek_time)
|
self.seek_forward()
|
||||||
|
|
||||||
def on_rest_button_press_event(self, widget, event):
|
def on_rest_button_press_event(self, widget, event):
|
||||||
if event.button == 1:
|
if event.button == 1:
|
||||||
self.client.seekcur("+"+self.seek_time)
|
self.seek_forward()
|
||||||
elif event.button == 3:
|
elif event.button == 3:
|
||||||
self.client.seekcur("-"+self.seek_time)
|
self.seek_backward()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
try:
|
try:
|
||||||
@ -2106,6 +2112,10 @@ class MainWindow(Gtk.ApplicationWindow):
|
|||||||
self.control.prev_button.emit("clicked")
|
self.control.prev_button.emit("clicked")
|
||||||
elif event.keyval == 65307: #esc
|
elif event.keyval == 65307: #esc
|
||||||
self.go_home_button.emit("clicked")
|
self.go_home_button.emit("clicked")
|
||||||
|
elif event.keyval == 65450: #*
|
||||||
|
self.progress.seek_forward()
|
||||||
|
elif event.keyval == 65455: #/
|
||||||
|
self.progress.seek_backward()
|
||||||
|
|
||||||
def on_save(self, action, param):
|
def on_save(self, action, param):
|
||||||
size=self.get_size()
|
size=self.get_size()
|
||||||
|
Loading…
Reference in New Issue
Block a user