Keep section labels inside fixed-width grid container

This commit is contained in:
2026-03-31 20:10:30 -05:00
parent 95ce30a209
commit 2861834647

View File

@@ -602,25 +602,7 @@ class SovranHubWindow(Adw.ApplicationWindow):
if not entries: if not entries:
continue continue
section_label = Gtk.Label( # Fixed-width container for label + separator + tiles
label=cat_label,
css_classes=["title-4"],
halign=Gtk.Align.START,
margin_top=20,
margin_bottom=4,
margin_start=24,
)
self._tiles_box.append(section_label)
sep = Gtk.Separator(
orientation=Gtk.Orientation.HORIZONTAL,
margin_start=24,
margin_end=24,
margin_bottom=8,
)
self._tiles_box.append(sep)
# Fixed-width container — tiles stay centered and compact
container = Gtk.Box( container = Gtk.Box(
orientation=Gtk.Orientation.VERTICAL, orientation=Gtk.Orientation.VERTICAL,
halign=Gtk.Align.CENTER, halign=Gtk.Align.CENTER,
@@ -628,6 +610,24 @@ class SovranHubWindow(Adw.ApplicationWindow):
) )
container.set_size_request(TILE_GRID_WIDTH, -1) container.set_size_request(TILE_GRID_WIDTH, -1)
section_label = Gtk.Label(
label=cat_label,
css_classes=["title-4"],
halign=Gtk.Align.START,
margin_top=20,
margin_bottom=4,
margin_start=8,
)
container.append(section_label)
sep = Gtk.Separator(
orientation=Gtk.Orientation.HORIZONTAL,
margin_start=8,
margin_end=8,
margin_bottom=8,
)
container.append(sep)
flowbox = Gtk.FlowBox( flowbox = Gtk.FlowBox(
max_children_per_line=4, max_children_per_line=4,
min_children_per_line=2, min_children_per_line=2,