parent
5eb9182097
commit
c1b611bac9
3 changed files with 193 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Changed
|
||||
|
||||
- grid-columns and grid-rows now accept an `auto` token to detect the optimal size.
|
||||
- grid-columns and grid-rows now accept an `auto` token to detect the optimal size https://github.com/Textualize/textual/pull/3107
|
||||
|
||||
## [0.33.0] - 2023-08-15
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
32
tests/snapshot_tests/snapshot_apps/auto_grid.py
Normal file
32
tests/snapshot_tests/snapshot_apps/auto_grid.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Label, Input
|
||||
from textual.containers import Container
|
||||
|
||||
|
||||
class GridApp(App):
|
||||
CSS = """
|
||||
Screen {
|
||||
align: center middle;
|
||||
}
|
||||
Container {
|
||||
layout: grid;
|
||||
grid-size: 2;
|
||||
grid-columns: auto 1fr;
|
||||
grid-rows: auto;
|
||||
height:auto;
|
||||
border: solid green;
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
with Container():
|
||||
yield Label("foo")
|
||||
yield Input()
|
||||
yield Label("Longer label")
|
||||
yield Input()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = GridApp()
|
||||
app.run()
|
||||
Loading…
Reference in a new issue