Fixing colors in select widget

This commit is contained in:
Darren Burns
2024-10-17 16:49:33 +01:00
parent 2a13416744
commit 0d1def6f54
2 changed files with 15 additions and 5 deletions

View File

@@ -207,6 +207,14 @@ class ColorSystem:
colors["text-muted"] = "ansi_default"
colors["text-disabled"] = "ansi_default"
# Foreground colors
colors["foreground-muted"] = get(
"foreground-muted", foreground.with_alpha(0.6).hex
)
colors["foreground-disabled"] = get(
"foreground-disabled", foreground.with_alpha(0.38).hex
)
# The cursor color for widgets such as OptionList, DataTable, etc.
colors["block-cursor-foreground"] = get(
"block-cursor-foreground", colors["text"]

View File

@@ -49,7 +49,7 @@ class SelectOverlay(OptionList):
SelectOverlay {
border: tall $border-blurred;
background: $surface;
color: $text;
color: $foreground;
width: 100%;
padding: 0 1;
}
@@ -110,7 +110,7 @@ class SelectCurrent(Horizontal):
DEFAULT_CSS = """
SelectCurrent {
color: $text;
color: $foreground;
width: 1fr;
height: auto;
padding: 0 2;
@@ -123,12 +123,12 @@ class SelectCurrent(Horizontal):
Static#label {
width: 1fr;
height: auto;
color: $text-disabled;
color: $foreground 50%;
background: transparent;
}
&.-has-value Static#label {
color: $text;
color: $foreground;
}
.arrow {
@@ -136,7 +136,7 @@ class SelectCurrent(Horizontal):
width: 1;
height: 1;
padding: 0 0 0 1;
color: $text-muted;
color: $foreground 50%;
background: transparent;
}
}
@@ -214,6 +214,7 @@ class Select(Generic[SelectType], Vertical, can_focus=True):
DEFAULT_CSS = """
Select {
height: auto;
color: $foreground;
background: $surface;
border: tall $border-blurred;
@@ -233,6 +234,7 @@ class Select(Generic[SelectType], Vertical, can_focus=True):
max-height: 12;
overlay: screen;
constrain: none inside;
color: $foreground;
&:focus {
border: tall $border;