Allow escape to leave the hidden library
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user