diff --git a/components/mobileshell/qml/homescreen/WallpaperSelector.qml b/components/mobileshell/qml/homescreen/WallpaperSelector.qml index 3e5e983d..c11f6182 100644 --- a/components/mobileshell/qml/homescreen/WallpaperSelector.qml +++ b/components/mobileshell/qml/homescreen/WallpaperSelector.qml @@ -15,24 +15,26 @@ import org.kde.plasma.private.mobileshell.wallpaperimageplugin as WallpaperImage Controls.Drawer { id: imageWallpaperDrawer dragMargin: 0 - + required property bool horizontal + signal wallpaperSettingsRequested() + onOpened: { wallpapersView.forceActiveFocus() } - + implicitWidth: Kirigami.Units.gridUnit * 10 implicitHeight: Kirigami.Units.gridUnit * 8 width: imageWallpaperDrawer.horizontal ? implicitWidth : parent.width height: imageWallpaperDrawer.horizontal ? parent.height : implicitHeight - + Wallpaper.ImageBackend { id: imageWallpaper } - + background: null - + ListView { id: wallpapersView anchors.fill: parent @@ -45,7 +47,37 @@ Controls.Drawer { snapMode: ListView.SnapToItem model: imageWallpaper.wallpaperModel // onCountChanged: currentIndex = Math.min(model.indexOf(configDialog.wallpaperConfiguration["Image"]), model.rowCount()-1) - headerPositioning: ListView.PullBackHeader + headerPositioning: ListView.InlineHeader + + header: Controls.ItemDelegate { + id: openSettings + width: imageWallpaperDrawer.horizontal ? parent.width : height * (imageWallpaperDrawer.width / imageWallpaperDrawer.Screen.height) + height: imageWallpaperDrawer.horizontal ? width / (imageWallpaperDrawer.Screen.width / imageWallpaperDrawer.Screen.height) : parent.height + padding: Kirigami.Units.gridUnit / 2 + leftPadding: padding + topPadding: padding + rightPadding: padding + bottomPadding: padding + + background: Rectangle { + color: Qt.rgba(255, 255, 255, (openSettings.down || openSettings.highlighted) ? 0.3 : 0.2) + radius: Kirigami.Units.gridUnit / 4 + anchors.fill: parent + anchors.margins: Kirigami.Units.gridUnit / 4 + } + + contentItem: Item { + Kirigami.Icon { + anchors.centerIn: parent + implicitHeight: Kirigami.Units.iconSizes.large + implicitWidth: Kirigami.Units.iconSizes.large + source: 'list-add' + } + } + + onClicked: imageWallpaperDrawer.wallpaperSettingsRequested() + Keys.onReturnPressed: clicked(); + } delegate: Controls.ItemDelegate { width: imageWallpaperDrawer.horizontal ? parent.width : height * (imageWallpaperDrawer.width / imageWallpaperDrawer.Screen.height) @@ -68,7 +100,7 @@ Controls.Drawer { wallpapersView.currentIndex = index; } } - + z: wallpapersView.currentIndex === index ? 2 : 0 contentItem: Item { Kirigami.Icon { diff --git a/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml b/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml index e3ce0321..941fadf4 100644 --- a/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml +++ b/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml @@ -190,6 +190,11 @@ Item { onClosed: { wallpaperSelectorLoader.active = false; } + + onWallpaperSettingsRequested: { + close(); + homeScreen.openConfigure(); + } } } } diff --git a/containments/homescreens/halcyon/package/contents/ui/SettingsScreen.qml b/containments/homescreens/halcyon/package/contents/ui/SettingsScreen.qml index 40de57df..a80437b7 100644 --- a/containments/homescreens/halcyon/package/contents/ui/SettingsScreen.qml +++ b/containments/homescreens/halcyon/package/contents/ui/SettingsScreen.qml @@ -65,7 +65,7 @@ Item { implicitHeight: Kirigami.Units.iconSizes.smallMedium source: 'edit-image' } - + QQC2.Label { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop text: i18n('Wallpapers') @@ -93,7 +93,7 @@ Item { implicitHeight: Kirigami.Units.iconSizes.smallMedium source: 'settings-configure' } - + QQC2.Label { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop text: i18n('Settings') @@ -127,6 +127,10 @@ Item { onClosed: { wallpaperSelectorLoader.active = false; } + onWallpaperSettingsRequested: { + close(); + root.homeScreen.openContainmentSettings(); + } } } }