mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Move the labels in the colour preview away from Static and into Label
This commit is contained in:
@@ -68,7 +68,7 @@ ColorGroup.-active {
|
||||
}
|
||||
|
||||
|
||||
ColorLabel {
|
||||
Label {
|
||||
padding: 0 0 1 0;
|
||||
content-align: center middle;
|
||||
color: $text;
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user