allow name as first positional arg

This commit is contained in:
Will McGugan
2021-07-10 09:24:23 +01:00
parent f1a77361fb
commit ae81b98f35
2 changed files with 5 additions and 5 deletions

View File

@@ -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",

View File

@@ -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 = (