mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-21 22:01:31 +03:00
Prevent multiple character selector dialogs from opening at once
This commit is contained in:
parent
74c4af1a5b
commit
61d1532552
3
paint.py
3
paint.py
@ -1305,10 +1305,13 @@ class PaintApp(App):
|
||||
|
||||
def action_open_character_selector(self) -> None:
|
||||
"""Show dialog to select a character."""
|
||||
for old_window in self.query("#character_selector_dialog").nodes:
|
||||
old_window.close()
|
||||
def handle_selected_character(character):
|
||||
self.selected_char = character
|
||||
window.close()
|
||||
window = CharacterSelectorDialog(
|
||||
id="character_selector_dialog",
|
||||
handle_selected_character=handle_selected_character,
|
||||
selected_character=self.selected_char,
|
||||
title=_("Choose Character"),
|
||||
|
Loading…
Reference in New Issue
Block a user