Skip to content

Commit

Permalink
snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Aug 27, 2024
1 parent 46a300e commit 11fd7ca
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3276,6 +3276,11 @@ async def on_event(self, event: events.Event) -> None:
pass

elif isinstance(event, events.Key):
# Special case for maximized widgets
# If something is maximized, then escape should minimize
if self.screen.maximized is not None and event.key == "escape":
self.screen.minimize()
return
if self.focused:
try:
self.screen._clear_tooltip()
Expand Down Expand Up @@ -3461,11 +3466,6 @@ async def _on_layout(self, message: messages.Layout) -> None:
message.stop()

async def _on_key(self, event: events.Key) -> None:
# Special case for maximized widgets
# If something is maximized, then escape should minimize
if self.screen.maximized is not None and event.key == "escape":
self.screen.minimize()
return
if not (await self._check_bindings(event.key)):
await dispatch_key(self, event)

Expand Down
Loading

0 comments on commit 11fd7ca

Please sign in to comment.