Skip to content

Commit

Permalink
Disable play pause action while searching
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Dec 10, 2023
1 parent 22852e7 commit 86d27e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cozy/ui/search_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 86d27e8

Please sign in to comment.