Fix warning icon visibility after the first display

It gets set to `display = False` when unmounting, I think.
This commit is contained in:
Isaiah Odhner 2023-04-20 21:00:43 -04:00
parent 986db57e17
commit 15af8f6403
2 changed files with 7 additions and 7 deletions

View File

@ -24,7 +24,7 @@ from textual.widget import Widget
from textual.widgets import Button, Static, Input, DirectoryTree, Header
from textual.color import Color
from menus import MenuBar, Menu, MenuItem, Separator
from windows import Window, DialogWindow, CharacterSelectorDialogWindow, MessageBox, warning_icon
from windows import Window, DialogWindow, CharacterSelectorDialogWindow, MessageBox, get_warning_icon
from localization.i18n import get as _, load_language
@ -1167,7 +1167,7 @@ class PaintApp(App):
window = MessageBox(
id="message_box",
title=title,
icon_widget=warning_icon,
icon_widget=get_warning_icon(),
message_widget=message_widget,
button_types=button_types,
handle_button=handle_button,

View File

@ -228,7 +228,7 @@ class CharacterSelectorDialogWindow(DialogWindow):
self.content.mount(Button("Cancel", classes="cancel"))
# ASCII line art version:
# warning_icon = Static("""[#ffff00]
# get_warning_icon = lambda: Static("""[#ffff00]
# _
# / \\
# / | \\
@ -236,7 +236,7 @@ class CharacterSelectorDialogWindow(DialogWindow):
# /_______\\
# [/]""", classes="warning_icon message_box_icon")
# Unicode solid version 1:
# warning_icon = Static("""[#ffff00 on #000000]
# get_warning_icon = lambda: Static("""[#ffff00 on #000000]
# _
# ◢█◣
# ◢[#000000 on #ffff00] ▼ [/]◣
@ -244,7 +244,7 @@ class CharacterSelectorDialogWindow(DialogWindow):
# ◢███████◣
# [/]""", classes="warning_icon message_box_icon")
# Unicode line art version (' might be a better than ╰/╯):
# warning_icon = Static("""[#ffff00]
# get_warning_icon = lambda: Static("""[#ffff00]
# _
#
# │ ╲
@ -252,7 +252,7 @@ class CharacterSelectorDialogWindow(DialogWindow):
# ╰───────╯
# """, classes="warning_icon message_box_icon")
# Unicode solid version 2:
# warning_icon = Static("""[#ffff00 on #000000]
# get_warning_icon = lambda: Static("""[#ffff00 on #000000]
# 🭯
# 🭅[#000000 on #ffff00]🭯[/]🭐
# 🭅[#000000 on #ffff00] ▼ [/]🭐
@ -263,7 +263,7 @@ class CharacterSelectorDialogWindow(DialogWindow):
# VS Code's terminal seems unsure of the width of these characters (like it's rendering 2 wide but advancing by 1), and has gaps/seams.
# Ubuntu's terminal looks better, and the graphics have less gaps, but the overall shape is worse.
# I guess a lot of this comes down to the font as well.
warning_icon = Static("""
get_warning_icon = lambda: Static("""
[#000000]🭋[#ffff00 on #000000]🭯[/]🭀[/]
[#000000]🭋[#ffff00 on #000000]🭅█🭐[/]🭀[/]
[#000000]🭋[#ffff00 on #000000]🭅[#000000 on #ffff00] ▼ [/]🭐[/]🭀[/]