added keybinding for SongPopover

This commit is contained in:
Martin Wagner 2020-07-01 18:04:01 +02:00
parent 8826140079
commit 252409a3f8

View File

@ -1010,7 +1010,15 @@ class SongsView(Gtk.TreeView):
treeview, treeiter=self.selection.get_selected() treeview, treeiter=self.selection.get_selected()
if not treeiter == None: if not treeiter == None:
self.client.files_to_playlist([self.store.get_value(treeiter, self.file_column_id)], True) self.client.files_to_playlist([self.store.get_value(treeiter, self.file_column_id)], True)
# elif event.keyval == 65383: #menu key elif event.keyval == 65383: #menu key
treeview, treeiter=self.selection.get_selected()
if not treeiter == None:
path=self.store.get_path(treeiter)
cell=self.get_cell_area(path, None)
file_name=self.store[path][self.file_column_id]
pop=SongPopover(self.client.lsinfo(file_name)[0], widget, int(cell.x), int(cell.y))
pop.popup()
pop.show_all()
self.handler_unblock(self.key_press_event) self.handler_unblock(self.key_press_event)
def clear(self): def clear(self):
@ -1774,6 +1782,15 @@ class PlaylistView(Gtk.Box):
self.remove_song(path) self.remove_song(path)
except: except:
pass pass
elif event.keyval == 65383: #menu key
treeview, treeiter=self.selection.get_selected()
if not treeiter == None:
path=self.store.get_path(treeiter)
cell=self.treeview.get_cell_area(path, None)
file_name=self.store[path][8]
pop=SongPopover(self.client.lsinfo(file_name)[0], widget, int(cell.x), int(cell.y))
pop.popup()
pop.show_all()
self.treeview.handler_unblock(self.key_press_event) self.treeview.handler_unblock(self.key_press_event)
def on_button_press_event(self, widget, event): def on_button_press_event(self, widget, event):