Add ASCII art warning icon to confirmation dialog

This commit is contained in:
Isaiah Odhner 2023-04-15 01:59:16 -04:00
parent b5e0ec8438
commit e814dd6637
2 changed files with 28 additions and 7 deletions

View File

@ -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;
}

View File

@ -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)