Move the labels in the colour preview away from Static and into Label

This commit is contained in:
Dave Pearson
2022-11-17 11:42:04 +00:00
parent 5a1b436e91
commit 5dcbd07f08
2 changed files with 3 additions and 7 deletions

View File

@@ -68,7 +68,7 @@ ColorGroup.-active {
}
ColorLabel {
Label {
padding: 0 0 1 0;
content-align: center middle;
color: $text;

View File

@@ -2,7 +2,7 @@ from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.design import ColorSystem
from textual.widget import Widget
from textual.widgets import Button, Footer, Static
from textual.widgets import Button, Footer, Static, Label
class ColorButtons(Vertical):
@@ -28,10 +28,6 @@ class Content(Vertical):
pass
class ColorLabel(Static):
pass
class ColorsView(Vertical):
def compose(self) -> ComposeResult:
@@ -47,7 +43,7 @@ class ColorsView(Vertical):
for color_name in ColorSystem.COLOR_NAMES:
items: list[Widget] = [ColorLabel(f'"{color_name}"')]
items: list[Widget] = [Label(f'"{color_name}"')]
for level in LEVELS:
color = f"{color_name}-{level}" if level else color_name
item = ColorItem(