1) Uses textuals CSS_PATH and an external tcss file to bundle all DEFAULT_CSS into one file
2) Added keyboard shortcut bindings for switching the language (Ctrl-T) and showing the help (Ctrl-A) The help should use a markdown viewer 3) Include a test folder containing all the tests
This commit is contained in:
@@ -13,35 +13,8 @@ from i18n import I18n
|
||||
class ErrorScreen(ModalScreen[None]):
|
||||
"""Modal dialog showing a title and a message, dismissed via OK."""
|
||||
|
||||
DEFAULT_CSS = """
|
||||
ErrorScreen {
|
||||
align: center middle;
|
||||
}
|
||||
|
||||
ErrorScreen > Container {
|
||||
width: 60%;
|
||||
max-width: 70;
|
||||
height: auto;
|
||||
border: thick $error 80%;
|
||||
background: $surface;
|
||||
padding: 1 2;
|
||||
}
|
||||
|
||||
ErrorScreen #error-title {
|
||||
text-style: bold;
|
||||
color: $error;
|
||||
margin-bottom: 1;
|
||||
}
|
||||
|
||||
ErrorScreen #error-message {
|
||||
margin-bottom: 1;
|
||||
}
|
||||
|
||||
ErrorScreen Horizontal {
|
||||
align-horizontal: center;
|
||||
height: auto;
|
||||
}
|
||||
"""
|
||||
# Styling for this screen lives in the app's shared external stylesheet
|
||||
# (app/styles.tcss), loaded via DownloadManagerApp.CSS_PATH.
|
||||
|
||||
def __init__(self, message: str, *, title: str | None = None) -> None:
|
||||
super().__init__()
|
||||
|
||||
Reference in New Issue
Block a user