From 86d27e881f1e32f6d91cce756cc0c70ae5b3c037 Mon Sep 17 00:00:00 2001 From: rdbende Date: Sun, 10 Dec 2023 11:21:32 +0100 Subject: [PATCH] Disable play pause action while searching --- cozy/ui/search_view.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cozy/ui/search_view.py b/cozy/ui/search_view.py index 5e4b01a8..2f6c3f69 100644 --- a/cozy/ui/search_view.py +++ b/cozy/ui/search_view.py @@ -29,6 +29,7 @@ class SearchView(Adw.Bin): reader_result_list: Gtk.ListBox = Gtk.Template.Child() view_model = inject.attr(SearchViewModel) + main_view = inject.attr("MainWindow") search_thread: threading.Thread search_thread_stop: threading.Event @@ -57,8 +58,10 @@ def close(self) -> None: def on_state_changed(self, widget: Gtk.Widget, param) -> None: if widget.get_property(param.name): self.library_stack.set_visible_child(self) + self.main_view.play_pause_action.set_enabled(False) else: self.close() + self.main_view.play_pause_action.set_enabled(True) def _on_search_changed(self, _) -> None: self.search_thread_stop.set()