From c3019230aef601f770137e5ef7127d783d22fbbb Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Thu, 18 Sep 2025 20:04:03 +0200 Subject: [PATCH] WallpaperSelector: even more layout changes --- .../WallpaperSelector/WallpaperSelector.qml | 71 ++++++++++--------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/Modules/WallpaperSelector/WallpaperSelector.qml b/Modules/WallpaperSelector/WallpaperSelector.qml index 5aadf1d7..02269ca7 100644 --- a/Modules/WallpaperSelector/WallpaperSelector.qml +++ b/Modules/WallpaperSelector/WallpaperSelector.qml @@ -14,7 +14,7 @@ NPanel { preferredWidth: 640 preferredHeight: 480 preferredWidthRatio: 0.4 - preferredHeightRatio: 0.48 + preferredHeightRatio: 0.52 panelAnchorHorizontalCenter: true panelAnchorVerticalCenter: true panelKeyboardFocus: true @@ -123,7 +123,39 @@ NPanel { Layout.fillWidth: true } - // Scroll container mirrors SettingsPanel to avoid overflow and keep interactions smooth + NToggle { + label: "Apply to all monitors" + description: "Apply selected wallpaper to all monitors at once." + checked: Settings.data.wallpaper.setWallpaperOnAllMonitors + onToggled: checked => Settings.data.wallpaper.setWallpaperOnAllMonitors = checked + visible: (wallpapersList.length > 0) + Layout.fillWidth: true + } + + // Filter input + RowLayout { + Layout.fillWidth: true + spacing: Style.marginM * scaling + + NText { + text: "Search:" + color: Color.mOnSurface + font.pointSize: Style.fontSizeM * scaling + Layout.preferredWidth: implicitWidth + } + + NTextInput { + placeholderText: "Type to filter wallpapers..." + text: filterText + onTextChanged: { + filterText = text + updateFiltered() + } + Layout.fillWidth: true + } + } + + // Scroll container for wallpaper grid only Flickable { Layout.fillWidth: true Layout.fillHeight: true @@ -141,37 +173,6 @@ NPanel { width: scrollView.availableWidth spacing: Style.marginM * scaling - NToggle { - label: "Apply to all monitors" - description: "Apply selected wallpaper to all monitors at once." - checked: Settings.data.wallpaper.setWallpaperOnAllMonitors - onToggled: checked => Settings.data.wallpaper.setWallpaperOnAllMonitors = checked - visible: (wallpapersList.length > 0) - } - - // Filter input - RowLayout { - Layout.fillWidth: true - spacing: Style.marginM * scaling - - NText { - text: "Search:" - color: Color.mOnSurface - font.pointSize: Style.fontSizeM * scaling - Layout.preferredWidth: implicitWidth - } - - NTextInput { - placeholderText: "Type to filter wallpapers..." - text: filterText - onTextChanged: { - filterText = text - updateFiltered() - } - Layout.fillWidth: true - } - } - // Grid container Item { visible: !WallpaperService.scanning @@ -189,7 +190,7 @@ NPanel { property int itemSize: Math.floor((width - leftMargin - rightMargin - (columns * Style.marginS * scaling)) / columns) cellWidth: Math.floor((width - leftMargin - rightMargin) / columns) - cellHeight: Math.floor(itemSize * 0.67) + Style.marginXS * scaling + Style.fontSizeXS * scaling + Style.marginS * scaling + cellHeight: Math.floor(itemSize * 0.7) + Style.marginXS * scaling + Style.fontSizeXS * scaling + Style.marginM * scaling leftMargin: Style.marginS * scaling rightMargin: Style.marginS * scaling @@ -279,6 +280,8 @@ NPanel { opacity: 0.5 font.pointSize: Style.fontSizeXS * scaling Layout.fillWidth: true + Layout.leftMargin: Style.marginS * scaling + Layout.rightMargin: Style.marginS * scaling Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight