From 57813295282ea5c67ee5c8c7dc49640e2c7224bf Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 9 Nov 2026 11:41:23 +0100 Subject: theme: schemes as a wrapping grid, not one long column With 23 schemes the page was a long scroll. Cards now flow into as many columns as fit at 380px, the width the mock and seven swatches need. Search still finds a card by objectName and scrolls via mapToItem, which a Flow does not change. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/appearance/ThemeTab.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'desktop/modules/appearance/ThemeTab.qml') diff --git a/desktop/modules/appearance/ThemeTab.qml b/desktop/modules/appearance/ThemeTab.qml index b842c32..c27a260 100644 --- a/desktop/modules/appearance/ThemeTab.qml +++ b/desktop/modules/appearance/ThemeTab.qml @@ -14,10 +14,13 @@ import "../.." // Colour schemes from unified-desktop-theme, each with its swatches and a mock // of a panel in its colours. Clicking one stages it; Apply in the header runs -// install.sh, as the wallpaper page does. -Column { +// install.sh, as the wallpaper page does. Cards wrap into as many columns as +// fit, so 23 schemes are a grid rather than one long scroll. +Flow { id: tab spacing: 10 + // 380 is the card's content: mock, gap, seven swatches, margins. + readonly property int cols: Math.max(1, Math.floor((width + spacing) / (380 + spacing))) Repeater { model: Udt.names @@ -30,7 +33,7 @@ Column { readonly property bool isCurrent: Udt.current === modelData readonly property bool isPending: Udt.pending === modelData && !isCurrent - width: tab.width + width: (tab.width - (tab.cols - 1) * tab.spacing) / tab.cols implicitHeight: 96 radius: 10 color: hover.hovered ? Qt.alpha(Theme.surface, 0.75) -- cgit v1.2.3