mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
unified button release and press events
This commit is contained in:
parent
7302bea05d
commit
b17106b45e
@ -1367,9 +1367,7 @@ class SongsList(TreeView):
|
|||||||
def _on_button_press_event(self, widget, event):
|
def _on_button_press_event(self, widget, event):
|
||||||
if (path_re:=widget.get_path_at_pos(int(event.x), int(event.y))) is not None:
|
if (path_re:=widget.get_path_at_pos(int(event.x), int(event.y))) is not None:
|
||||||
path=path_re[0]
|
path=path_re[0]
|
||||||
if event.button == 1 and event.type == Gdk.EventType._2BUTTON_PRESS:
|
if event.button == 2 and event.type == Gdk.EventType.BUTTON_PRESS:
|
||||||
self._client.files_to_playlist([self._store[path][3]], "play")
|
|
||||||
elif event.button == 2 and event.type == Gdk.EventType.BUTTON_PRESS:
|
|
||||||
self._client.files_to_playlist([self._store[path][3]], "append")
|
self._client.files_to_playlist([self._store[path][3]], "append")
|
||||||
elif event.button == 3 and event.type == Gdk.EventType.BUTTON_PRESS:
|
elif event.button == 3 and event.type == Gdk.EventType.BUTTON_PRESS:
|
||||||
uri=self._store[path][3]
|
uri=self._store[path][3]
|
||||||
@ -2009,7 +2007,7 @@ class AlbumView(Gtk.Box):
|
|||||||
|
|
||||||
# connect
|
# connect
|
||||||
self.connect("hide", lambda *args: print("test"))
|
self.connect("hide", lambda *args: print("test"))
|
||||||
event_box.connect("button-press-event", self._on_button_press_event)
|
event_box.connect("button-release-event", self._on_button_release_event)
|
||||||
|
|
||||||
# packing
|
# packing
|
||||||
event_box.add(self._cover)
|
event_box.add(self._cover)
|
||||||
@ -2065,8 +2063,8 @@ class AlbumView(Gtk.Box):
|
|||||||
size=self._settings.get_int("album-cover")*1.5
|
size=self._settings.get_int("album-cover")*1.5
|
||||||
self._cover.set_from_pixbuf(cover.get_pixbuf(size))
|
self._cover.set_from_pixbuf(cover.get_pixbuf(size))
|
||||||
|
|
||||||
def _on_button_press_event(self, widget, event):
|
def _on_button_release_event(self, widget, event):
|
||||||
if event.button == 1 and event.type == Gdk.EventType.BUTTON_PRESS:
|
if event.button == 1:
|
||||||
self.emit("close")
|
self.emit("close")
|
||||||
|
|
||||||
class Browser(Gtk.Paned):
|
class Browser(Gtk.Paned):
|
||||||
|
Loading…
Reference in New Issue
Block a user