mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 14:21:33 +03:00
Add ASCII art warning icon to confirmation dialog
This commit is contained in:
parent
b5e0ec8438
commit
e814dd6637
15
paint.css
15
paint.css
@ -199,12 +199,21 @@ Button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#overwrite_dialog .window_content {
|
#overwrite_dialog .window_content {
|
||||||
padding: 2 4;
|
width: 50;
|
||||||
width: 40;
|
|
||||||
height: 15;
|
height: 15;
|
||||||
}
|
}
|
||||||
#overwrite_dialog .window_content Button {
|
#overwrite_dialog .window_content Button {
|
||||||
width: auto;
|
width: auto;
|
||||||
height: 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
20
paint.py
20
paint.py
@ -728,11 +728,23 @@ class PaintApp(App):
|
|||||||
title="Save As",
|
title="Save As",
|
||||||
)
|
)
|
||||||
window.content.mount(
|
window.content.mount(
|
||||||
Static(filename + " already exists.", markup=False),
|
|
||||||
Static("Do you want to replace it?"),
|
|
||||||
Horizontal(
|
Horizontal(
|
||||||
Button("Yes", id="overwrite_yes_button"),
|
Static("""[#ffff00]
|
||||||
Button("No", id="overwrite_no_button"),
|
_
|
||||||
|
/ \\
|
||||||
|
/ | \\
|
||||||
|
/ . \\
|
||||||
|
/_______\\
|
||||||
|
[/]""", 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)
|
self.mount(window)
|
||||||
|
Loading…
Reference in New Issue
Block a user