fix(ui): use DEFAULT_CSS with selectors in detail screens
All checks were successful
Build and Release .deb / build-deb (push) Successful in 21s

- Replace inline CSS string with DEFAULT_CSS class attribute
- Add proper Textual CSS selectors (ScreenName, #toolbar, DataTable)
- Remove invalid align at root level
This commit is contained in:
enzo 2026-05-13 01:48:00 +02:00
parent 1715a6cf01
commit 07e84ae69f

View file

@ -9,24 +9,22 @@ except Exception:
PYPERCLIP_OK = False
SCREEN_CSS = """
align: left top;
padding: 1 2;
#toolbar {
class PackageListScreen(Screen):
BINDINGS = [("b", "back", "Retour")]
DEFAULT_CSS = """
PackageListScreen {
align: left top;
padding: 1 2;
}
PackageListScreen #toolbar {
height: auto;
dock: top;
margin-bottom: 1;
}
DataTable {
PackageListScreen DataTable {
height: 1fr;
border: solid $primary;
}
"""
class PackageListScreen(Screen):
BINDINGS = [("b", "back", "Retour")]
CSS = SCREEN_CSS
"""
def __init__(self, packages: list[dict]):
super().__init__()
@ -52,7 +50,20 @@ class PackageListScreen(Screen):
class CVEListScreen(Screen):
BINDINGS = [("b", "back", "Retour")]
CSS = SCREEN_CSS
DEFAULT_CSS = """
CVEListScreen {
align: left top;
padding: 1 2;
}
CVEListScreen #toolbar {
height: auto;
margin-bottom: 1;
}
CVEListScreen DataTable {
height: 1fr;
border: solid $primary;
}
"""
def __init__(self, cves: list[dict]):
super().__init__()