mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Various DataTable style fixes - fix text colors, fixed header styling in themes
This commit is contained in:
@@ -436,6 +436,8 @@ class ChangingThemeApp(App[None]):
|
||||
table.add_columns(*HEADERS)
|
||||
table.add_rows(ROWS)
|
||||
table.zebra_stripes = True
|
||||
table.fixed_columns = 1
|
||||
table.cursor_type = "row"
|
||||
yield table
|
||||
yield ListView(
|
||||
ListItem(Label("One")),
|
||||
|
||||
@@ -320,6 +320,10 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
|
||||
&.datatable--fixed-cursor {
|
||||
background: $block-cursor-blurred-background;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
background-tint: $foreground 5%;
|
||||
& > .datatable--cursor {
|
||||
@@ -331,12 +335,17 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
|
||||
& > .datatable--header {
|
||||
background-tint: $foreground 5%;
|
||||
}
|
||||
|
||||
& > .datatable--fixed-cursor {
|
||||
color: $block-cursor-foreground;
|
||||
background: $block-cursor-background;
|
||||
}
|
||||
}
|
||||
|
||||
&:dark {
|
||||
background: $surface;
|
||||
& > .datatable--even-row {
|
||||
background: $surface-lighten-1 50%;
|
||||
background: $surface-darken-1 40%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +361,7 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
|
||||
|
||||
& > .datatable--fixed {
|
||||
background: $secondary 50%;
|
||||
color: $text;
|
||||
color: $foreground;
|
||||
}
|
||||
|
||||
& > .datatable--odd-row {
|
||||
@@ -370,13 +379,13 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
|
||||
}
|
||||
|
||||
& > .datatable--fixed-cursor {
|
||||
background: $block-cursor-background;
|
||||
color: $text;
|
||||
background: $block-cursor-blurred-background;
|
||||
color: $foreground;
|
||||
}
|
||||
|
||||
& > .datatable--header-cursor {
|
||||
background: $accent-darken-1;
|
||||
color: $text;
|
||||
color: $foreground;
|
||||
}
|
||||
|
||||
& > .datatable--header-hover {
|
||||
|
||||
Reference in New Issue
Block a user