mirror of
https://github.com/1j01/textual-paint.git
synced 2024-11-28 01:34:42 +03:00
Prevent focusing character input when closing dialogs
This commit is contained in:
parent
45b28f142f
commit
d61de649a6
@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Plain text files (`.txt`) are now saved with CRLF line endings on Windows.
|
- Plain text files (`.txt`) are now saved with CRLF line endings on Windows.
|
||||||
|
- When closing dialogs, the character input no longer becomes focused.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -216,7 +216,6 @@ To preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja,
|
|||||||
### Misc
|
### Misc
|
||||||
- Extraneous undo states may be created in some cases. In particular, I noticed when undoing/redoing with free-typing mode, the last state had no cursor but was otherwise identical.
|
- Extraneous undo states may be created in some cases. In particular, I noticed when undoing/redoing with free-typing mode, the last state had no cursor but was otherwise identical.
|
||||||
- Document recovery dialog is shown unnecessarily if the backup file is identical.
|
- Document recovery dialog is shown unnecessarily if the backup file is identical.
|
||||||
- Closing dialogs focuses the character input which is undesirable as it prevents typing in the canvas or copying the selection with <kbd>Ctrl</kbd>+<kbd>C</kbd> etc. (You can use <kbd>Esc</kbd> to reset focus.)
|
|
||||||
- Pressing a key to exit View Bitmap mode may cause unwanted side effects.
|
- Pressing a key to exit View Bitmap mode may cause unwanted side effects.
|
||||||
- Pressing a key doesn't exit View Bitmap mode if the character input is focused.
|
- Pressing a key doesn't exit View Bitmap mode if the character input is focused.
|
||||||
|
|
||||||
|
@ -395,6 +395,8 @@ class Window(Container):
|
|||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
"""Force close the window."""
|
"""Force close the window."""
|
||||||
|
# Before removing from the DOM, unfocus, because otherwise Textual will try to focus a widget "nearby" in the focus order, in `_reset_focus`.
|
||||||
|
self.app.set_focus(None)
|
||||||
self.remove()
|
self.remove()
|
||||||
self.post_message(self.Closed())
|
self.post_message(self.Closed())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user