From e814dd6637f3361850cd66b5643fd945d4a30ca1 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Sat, 15 Apr 2023 01:59:16 -0400 Subject: [PATCH] Add ASCII art warning icon to confirmation dialog --- paint.css | 15 ++++++++++++--- paint.py | 20 ++++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/paint.css b/paint.css index 1bf18ff..241d366 100644 --- a/paint.css +++ b/paint.css @@ -199,12 +199,21 @@ Button { } #overwrite_dialog .window_content { - padding: 2 4; - width: 40; + width: 50; height: 15; } #overwrite_dialog .window_content Button { width: auto; height: auto; + margin-right: 1; + margin-top: 1; +} +#overwrite_dialog .warning_icon { + width: auto; + height: auto; + padding-left: 2; +} +#overwrite_dialog .main_content { + padding: 2 2; + width: 1fr; } - diff --git a/paint.py b/paint.py index 96009b0..85d7360 100644 --- a/paint.py +++ b/paint.py @@ -728,11 +728,23 @@ class PaintApp(App): title="Save As", ) window.content.mount( - Static(filename + " already exists.", markup=False), - Static("Do you want to replace it?"), Horizontal( - Button("Yes", id="overwrite_yes_button"), - Button("No", id="overwrite_no_button"), + Static("""[#ffff00] + _ + / \\ + / | \\ + / . \\ +/_______\\ +[/]""", classes="warning_icon"), + Vertical( + Static(filename + " already exists.", markup=False), + Static("Do you want to replace it?"), + Horizontal( + Button("Yes", id="overwrite_yes_button"), + Button("No", id="overwrite_no_button"), + ), + classes="main_content" + ) ) ) self.mount(window)