Allow escape to leave the hidden library

This commit is contained in:
kramo
2023-06-30 13:36:27 +02:00
parent f4f6d73d4a
commit ad0e5b2abf

View File

@@ -303,13 +303,13 @@ class CartridgesWindow(Adw.ApplicationWindow):
search_entry.set_text("") search_entry.set_text("")
def on_escape_action(self, *_args): def on_escape_action(self, *_args):
if self.stack.get_visible_child() == self.details_view: if (
self.on_go_back_action()
elif (
self.get_focus() == self.search_entry.get_focus_child() self.get_focus() == self.search_entry.get_focus_child()
or self.hidden_search_entry.get_focus_child() or self.hidden_search_entry.get_focus_child()
): ):
self.on_toggle_search_action() self.on_toggle_search_action()
else:
self.on_go_back_action()
def on_undo_action(self, _widget, game=None, undo=None): def on_undo_action(self, _widget, game=None, undo=None):
if not game: # If the action was activated via Ctrl + Z if not game: # If the action was activated via Ctrl + Z