fix(ui): use DEFAULT_CSS with selectors in detail screens
All checks were successful
Build and Release .deb / build-deb (push) Successful in 21s
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:
parent
1715a6cf01
commit
07e84ae69f
1 changed files with 24 additions and 13 deletions
|
|
@ -9,24 +9,22 @@ except Exception:
|
||||||
PYPERCLIP_OK = False
|
PYPERCLIP_OK = False
|
||||||
|
|
||||||
|
|
||||||
SCREEN_CSS = """
|
class PackageListScreen(Screen):
|
||||||
|
BINDINGS = [("b", "back", "Retour")]
|
||||||
|
DEFAULT_CSS = """
|
||||||
|
PackageListScreen {
|
||||||
align: left top;
|
align: left top;
|
||||||
padding: 1 2;
|
padding: 1 2;
|
||||||
#toolbar {
|
}
|
||||||
|
PackageListScreen #toolbar {
|
||||||
height: auto;
|
height: auto;
|
||||||
dock: top;
|
|
||||||
margin-bottom: 1;
|
margin-bottom: 1;
|
||||||
}
|
}
|
||||||
DataTable {
|
PackageListScreen DataTable {
|
||||||
height: 1fr;
|
height: 1fr;
|
||||||
border: solid $primary;
|
border: solid $primary;
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class PackageListScreen(Screen):
|
|
||||||
BINDINGS = [("b", "back", "Retour")]
|
|
||||||
CSS = SCREEN_CSS
|
|
||||||
|
|
||||||
def __init__(self, packages: list[dict]):
|
def __init__(self, packages: list[dict]):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
@ -52,7 +50,20 @@ class PackageListScreen(Screen):
|
||||||
|
|
||||||
class CVEListScreen(Screen):
|
class CVEListScreen(Screen):
|
||||||
BINDINGS = [("b", "back", "Retour")]
|
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]):
|
def __init__(self, cves: list[dict]):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue