mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
allow name as first positional arg
This commit is contained in:
@@ -14,9 +14,9 @@ class GridTest(App):
|
|||||||
layout = GridLayout(gap=1, gutter=1, align=("center", "center"))
|
layout = GridLayout(gap=1, gutter=1, align=("center", "center"))
|
||||||
await self.push_view(View(layout=layout))
|
await self.push_view(View(layout=layout))
|
||||||
|
|
||||||
layout.add_column(name="col", max_size=20, repeat=4)
|
layout.add_column("col", max_size=20, repeat=4)
|
||||||
layout.add_row(name="numbers", max_size=10)
|
layout.add_row("numbers", max_size=10)
|
||||||
layout.add_row(name="row", max_size=10, repeat=4)
|
layout.add_row("row", max_size=10, repeat=4)
|
||||||
|
|
||||||
layout.add_areas(
|
layout.add_areas(
|
||||||
numbers="col1-start|col4-end,numbers",
|
numbers="col1-start|col4-end,numbers",
|
||||||
|
|||||||
@@ -76,12 +76,12 @@ class GridLayout(Layout):
|
|||||||
|
|
||||||
def add_column(
|
def add_column(
|
||||||
self,
|
self,
|
||||||
|
name: str | None = None,
|
||||||
*,
|
*,
|
||||||
size: int | None = None,
|
size: int | None = None,
|
||||||
fraction: int = 1,
|
fraction: int = 1,
|
||||||
min_size: int = 1,
|
min_size: int = 1,
|
||||||
max_size: int | None = None,
|
max_size: int | None = None,
|
||||||
name: str | None = None,
|
|
||||||
repeat: int = 1,
|
repeat: int = 1,
|
||||||
) -> None:
|
) -> None:
|
||||||
names = (
|
names = (
|
||||||
@@ -103,12 +103,12 @@ class GridLayout(Layout):
|
|||||||
|
|
||||||
def add_row(
|
def add_row(
|
||||||
self,
|
self,
|
||||||
|
name: str | None = None,
|
||||||
*,
|
*,
|
||||||
size: int | None = None,
|
size: int | None = None,
|
||||||
fraction: int = 1,
|
fraction: int = 1,
|
||||||
min_size: int = 1,
|
min_size: int = 1,
|
||||||
max_size: int | None = None,
|
max_size: int | None = None,
|
||||||
name: str | None = None,
|
|
||||||
repeat: int = 1,
|
repeat: int = 1,
|
||||||
) -> None:
|
) -> None:
|
||||||
names = (
|
names = (
|
||||||
|
|||||||
Reference in New Issue
Block a user