made release-events act more like actual buttons

This commit is contained in:
Martin Wagner 2023-01-16 20:46:02 +01:00
parent b17106b45e
commit da1e516f51

View File

@ -2065,6 +2065,7 @@ class AlbumView(Gtk.Box):
def _on_button_release_event(self, widget, event):
if event.button == 1:
if 0 <= event.x <= widget.get_allocated_width() and 0 <= event.y <= widget.get_allocated_height():
self.emit("close")
class Browser(Gtk.Paned):
@ -2799,6 +2800,7 @@ class SeekBar(Gtk.Box):
self._client.seekcur(value)
def _on_label_button_release_event(self, widget, event, scroll_type):
if 0 <= event.x <= widget.get_allocated_width() and 0 <= event.y <= widget.get_allocated_height():
self._scale.emit("move-slider", scroll_type.get(event.button, Gtk.ScrollType.NONE))
def _on_label_button_press_event(self, widget, event):