fix(settings): make color scheme grid layout responsive

The color scheme grid previously used a fixed number of columns, which
caused cards to be partially clipped when the window width was narrow.

This change makes the number of columns dynamically calculated based on
the available width. It ensures the grid layout gracefully adapts from 3
(or more) columns down to 1 column, preventing content overflow and
clipping.

This fixes a UI bug where the right-side content of color scheme cards
was not visible at certain window widths.
This commit is contained in:
loner
2025-10-07 04:43:49 +08:00
parent fcba1cc3c6
commit 232b452b11
+1 -1
View File
@@ -220,7 +220,7 @@ ColumnLayout {
// Color Schemes Grid
GridLayout {
columns: 3
columns: Math.max(1, Math.floor((root.width + columnSpacing) / (222 * scaling + columnSpacing)))
rowSpacing: Style.marginM * scaling
columnSpacing: Style.marginM * scaling
Layout.fillWidth: true