mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
updated snapshot
This commit is contained in:
@@ -62,9 +62,9 @@ We have a new list view control to navigate and select items in a list. Items ca
|
|||||||
|
|
||||||
The Placeholder widget was broken since the big CSS update. We've brought it back and given it a bit of a polish.
|
The Placeholder widget was broken since the big CSS update. We've brought it back and given it a bit of a polish.
|
||||||
|
|
||||||
Use this widget in place of custom widgets you have yet to build when designing your UI.
|
Use this widget in place of custom widgets you have yet to build when designing your UI. The colors are automatically cycled to differentiate one placeholder rom the next. You can click a placeholder to cycle between its ID, size, and lorem ipsum text.
|
||||||
|
|
||||||
```{.textual path="docs/examples/widgets/placeholder.py"}
|
```{.textual path="docs/examples/widgets/placeholder.py" columns="100" lines="45"}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class PlaceholderApp(App):
|
|||||||
Placeholder(variant="size", id="col3"),
|
Placeholder(variant="size", id="col3"),
|
||||||
id="c1",
|
id="c1",
|
||||||
),
|
),
|
||||||
id="bot"
|
id="bot",
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
Placeholder(variant="text", id="left"),
|
Placeholder(variant="text", id="left"),
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from ..containers import Container
|
|||||||
from ..css._error_tools import friendly_list
|
from ..css._error_tools import friendly_list
|
||||||
from ..reactive import Reactive, reactive
|
from ..reactive import Reactive, reactive
|
||||||
from ..widget import Widget, RenderResult
|
from ..widget import Widget, RenderResult
|
||||||
from ..widgets import Label
|
|
||||||
from .._typing import Literal
|
from .._typing import Literal
|
||||||
|
|
||||||
PlaceholderVariant = Literal["default", "size", "text"]
|
PlaceholderVariant = Literal["default", "size", "text"]
|
||||||
@@ -65,6 +64,7 @@ class Placeholder(Container):
|
|||||||
DEFAULT_CSS = """
|
DEFAULT_CSS = """
|
||||||
Placeholder {
|
Placeholder {
|
||||||
align: center middle;
|
align: center middle;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
Placeholder.-text {
|
Placeholder.-text {
|
||||||
@@ -73,6 +73,7 @@ class Placeholder(Container):
|
|||||||
|
|
||||||
_PlaceholderLabel {
|
_PlaceholderLabel {
|
||||||
height: auto;
|
height: auto;
|
||||||
|
color: $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
Placeholder > _PlaceholderLabel {
|
Placeholder > _PlaceholderLabel {
|
||||||
@@ -137,7 +138,7 @@ class Placeholder(Container):
|
|||||||
"-size",
|
"-size",
|
||||||
)
|
)
|
||||||
self._text_label = _PlaceholderLabel(
|
self._text_label = _PlaceholderLabel(
|
||||||
_LOREM_IPSUM_PLACEHOLDER_TEXT,
|
"\n\n".join(_LOREM_IPSUM_PLACEHOLDER_TEXT for _ in range(5)),
|
||||||
"-text",
|
"-text",
|
||||||
)
|
)
|
||||||
super().__init__(
|
super().__init__(
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user