diff --git a/full_updater/ui/detail_screens.py b/full_updater/ui/detail_screens.py index 31723fb..7299705 100644 --- a/full_updater/ui/detail_screens.py +++ b/full_updater/ui/detail_screens.py @@ -1,5 +1,5 @@ from textual.screen import Screen -from textual.widgets import DataTable, Button, Static +from textual.widgets import DataTable, Button from textual.containers import Vertical, Horizontal try: @@ -9,8 +9,24 @@ except Exception: PYPERCLIP_OK = False +SCREEN_CSS = """ + align: left top; + padding: 1 2; + #toolbar { + height: auto; + dock: top; + margin-bottom: 1; + } + DataTable { + height: 1fr; + border: solid $primary; + } +""" + + class PackageListScreen(Screen): BINDINGS = [("b", "back", "Retour")] + CSS = SCREEN_CSS def __init__(self, packages: list[dict]): super().__init__() @@ -18,7 +34,7 @@ class PackageListScreen(Screen): def compose(self): with Vertical(): - with Horizontal(id="pkg-toolbar"): + with Horizontal(id="toolbar"): yield Button("⬅ Retour", id="pkg-back", variant="default") table = DataTable(id="pkg-table") table.add_columns("Nom", "Version actuelle", "Nouvelle version", "Taille") @@ -36,6 +52,7 @@ class PackageListScreen(Screen): class CVEListScreen(Screen): BINDINGS = [("b", "back", "Retour")] + CSS = SCREEN_CSS def __init__(self, cves: list[dict]): super().__init__() @@ -44,7 +61,7 @@ class CVEListScreen(Screen): def compose(self): with Vertical(): - with Horizontal(id="cve-toolbar"): + with Horizontal(id="toolbar"): yield Button("⬅ Retour", id="cve-back", variant="default") table = DataTable(id="cve-table") table.add_columns("CVE-ID", "Paquet", "Lien")