Make a filled Unicode warning icon with a border

This commit is contained in:
Isaiah Odhner 2023-04-17 02:24:12 -04:00
parent a948d7d945
commit 4ee5efe85c

View File

@ -829,7 +829,7 @@ class PaintApp(App):
# / . \\
# /_______\\
# [/]""", classes="warning_icon")
# Unicode solid version:
# Unicode solid version 1:
# warning_icon = Static("""[#ffff00 on #000000]
# _
# ◢█◣
@ -837,13 +837,33 @@ class PaintApp(App):
# ◢[#000000 on #ffff00] ● [/]◣
# ◢███████◣
# [/]""", classes="warning_icon")
# Unicode line art version:
warning_icon = Static("""[#ffff00]
_
.
# Unicode line art version (' might be a better than ╰/╯):
# warning_icon = Static("""[#ffff00]
# _
#
# │ ╲
# . ╲
# ╰───────╯
# """, classes="warning_icon")
# Unicode solid version 2:
# warning_icon = Static("""[#ffff00 on #000000]
# 🭯
# 🭅[#000000 on #ffff00]🭯[/]🭐
# 🭅[#000000 on #ffff00] ▼ [/]🭐
# 🭅[#000000 on #ffff00] ● [/]🭐
# 🭅███████🭐
# [/]""", classes="warning_icon")
# Unicode solid version 3, now with a border:
# 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("""
[#000000]🭋[#ffff00 on #000000]🭯[/]🭀[/]
[#000000]🭋[#ffff00 on #000000]🭅█🭐[/]🭀[/]
[#000000]🭋[#ffff00 on #000000]🭅[#000000 on #ffff00] ▼ [/]🭐[/]🭀[/]
[#000000]🭋[#ffff00 on #000000]🭅[#000000 on #ffff00] ● [/]🭐[/]🭀[/]
[#000000]🭋[#ffff00 on #000000]🭅███████🭐[/]🭀[/]
[#000000]🮃🮃🮃🮃🮃🮃🮃🮃🮃🮃🮃[/]
""", classes="warning_icon")
window.content.mount(
Horizontal(