mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
black
This commit is contained in:
@@ -325,20 +325,17 @@ class GridLayout(Layout):
|
|||||||
# Widgets with no area assigned.
|
# Widgets with no area assigned.
|
||||||
auto_widgets = (widget for widget, area in self.widgets.items() if area is None)
|
auto_widgets = (widget for widget, area in self.widgets.items() if area is None)
|
||||||
|
|
||||||
grid_refs = sorted(
|
grid_slots = sorted(
|
||||||
product(range(column_count), range(row_count)), key=itemgetter(1, 0)
|
(
|
||||||
|
slot
|
||||||
|
for slot in product(range(column_count), range(row_count))
|
||||||
|
if slot in free_slots
|
||||||
|
),
|
||||||
|
key=itemgetter(1, 0),
|
||||||
)
|
)
|
||||||
iter_grid = iter(grid_refs)
|
|
||||||
|
|
||||||
for widget in auto_widgets:
|
for widget, (col, row) in zip(auto_widgets, grid_slots):
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
slot = next(iter_grid)
|
|
||||||
if slot in free_slots:
|
|
||||||
break
|
|
||||||
except StopIteration:
|
|
||||||
break
|
|
||||||
col, row = slot
|
|
||||||
col_name = column_names[col]
|
col_name = column_names[col]
|
||||||
row_name = row_names[row]
|
row_name = row_names[row]
|
||||||
_col1, x1 = column_tracks[f"{col_name}-start"]
|
_col1, x1 = column_tracks[f"{col_name}-start"]
|
||||||
|
|||||||
Reference in New Issue
Block a user