Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jul 20, 2021
1 parent 11d213a commit 42841c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/textual/layouts/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def resolve(
size: int, edges: list[GridOptions], gap: int, repeat: bool
) -> Iterable[tuple[int, int]]:
total_gap = gap * (len(edges) - 1)
tracks: Iterable[int]
tracks = [
track if edge.max_size is None else min(edge.max_size, track)
for track, edge in zip(layout_resolve(size - total_gap, edges), edges)
Expand All @@ -314,7 +315,7 @@ def resolve_tracks(

max_size = 0
tracks: dict[str, tuple[int, int]] = {}
counts = defaultdict(int)
counts: dict[str, int] = defaultdict(int)
if repeat:
names = []
for index, (name, (start, end)) in enumerate(spans):
Expand Down Expand Up @@ -373,7 +374,7 @@ def add_widget(widget: Widget, region: Region, order: tuple[int, int]):
(col, row) for col, row in product(range(column_count), range(row_count))
}

map = {}
map: dict[Widget, OrderedRegion] = {}
order = 1
from_corners = Region.from_corners
gutter = Point(self.column_gutter, self.row_gutter)
Expand Down

0 comments on commit 42841c5

Please sign in to comment.