From 0029f2d48a67f838f1ca77055625a6dbfd88686e Mon Sep 17 00:00:00 2001 From: ATMDA Date: Thu, 20 Nov 2025 10:42:48 -0500 Subject: controlcenter: wallpaper now uses gridview, removed custom lazy loading --- .../controlcenter/appearance/AppearancePane.qml | 74 ++++++++-------------- 1 file changed, 26 insertions(+), 48 deletions(-) (limited to 'modules/controlcenter/appearance') diff --git a/modules/controlcenter/appearance/AppearancePane.qml b/modules/controlcenter/appearance/AppearancePane.qml index aea0085..b6acbe5 100644 --- a/modules/controlcenter/appearance/AppearancePane.qml +++ b/modules/controlcenter/appearance/AppearancePane.qml @@ -79,71 +79,49 @@ Item { Component { id: appearanceRightContentComponent - StyledFlickable { + Item { id: rightAppearanceFlickable - flickableDirection: Flickable.VerticalFlick - contentHeight: contentLayout.height - - StyledScrollBar.vertical: StyledScrollBar { - flickable: rightAppearanceFlickable - } ColumnLayout { id: contentLayout - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - spacing: Appearance.spacing.normal - - SettingsHeader { - icon: "palette" - title: qsTr("Appearance Settings") - } + anchors.fill: parent + spacing: 0 StyledText { - Layout.topMargin: Appearance.spacing.large Layout.alignment: Qt.AlignHCenter + Layout.bottomMargin: Appearance.spacing.normal text: qsTr("Wallpaper") font.pointSize: Appearance.font.size.extraLarge font.weight: 600 } - StyledText { - Layout.alignment: Qt.AlignHCenter - text: qsTr("Select a wallpaper") - font.pointSize: Appearance.font.size.normal - color: Colours.palette.m3onSurfaceVariant - } - - Item { + Loader { + id: wallpaperLoader + Layout.fillWidth: true - Layout.topMargin: Appearance.spacing.large - Layout.preferredHeight: wallpaperLoader.item ? wallpaperLoader.item.layoutPreferredHeight : 0 + Layout.fillHeight: true + Layout.bottomMargin: -Appearance.padding.large * 2 - Loader { - id: wallpaperLoader - anchors.fill: parent - asynchronous: true - active: { - const isActive = root.session.activeIndex === 3; - const isAdjacent = Math.abs(root.session.activeIndex - 3) === 1; - const splitLayout = root.children[0]; - const loader = splitLayout && splitLayout.rightLoader ? splitLayout.rightLoader : null; - const shouldActivate = loader && loader.item !== null && (isActive || isAdjacent); - return shouldActivate; - } - - onStatusChanged: { - if (status === Loader.Error) { - console.error("[AppearancePane] Wallpaper loader error!"); - } - } - - sourceComponent: WallpaperGrid { - session: root.session + asynchronous: true + active: { + const isActive = root.session.activeIndex === 3; + const isAdjacent = Math.abs(root.session.activeIndex - 3) === 1; + const splitLayout = root.children[0]; + const loader = splitLayout && splitLayout.rightLoader ? splitLayout.rightLoader : null; + const shouldActivate = loader && loader.item !== null && (isActive || isAdjacent); + return shouldActivate; + } + + onStatusChanged: { + if (status === Loader.Error) { + console.error("[AppearancePane] Wallpaper loader error!"); } } + + sourceComponent: WallpaperGrid { + session: root.session + } } } } -- cgit v1.2.3-freya