Keep section labels inside fixed-width grid container
This commit is contained in:
@@ -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,
|
||||||
@@ -727,4 +727,4 @@ class SovranHubApp(Adw.Application):
|
|||||||
win = self.get_active_window()
|
win = self.get_active_window()
|
||||||
if not win:
|
if not win:
|
||||||
win = SovranHubWindow(self, self._config)
|
win = SovranHubWindow(self, self._config)
|
||||||
win.present()
|
win.present()
|
||||||
|
|||||||
Reference in New Issue
Block a user