homescreen: Add button to wallpaper selector to go to advanced settings

Currently you need to go from Settings -> "Switch between homescreens and more wallpaper options" to access the advanced wallpaper settings. Add a button directly into the wallpaper selector for this.
This commit is contained in:
Devin Lin 2024-07-03 18:38:10 -04:00
parent 1fc13f6d0f
commit 56ca0db5c6
3 changed files with 50 additions and 9 deletions

View file

@ -18,6 +18,8 @@ Controls.Drawer {
required property bool horizontal
signal wallpaperSettingsRequested()
onOpened: {
wallpapersView.forceActiveFocus()
}
@ -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)

View file

@ -190,6 +190,11 @@ Item {
onClosed: {
wallpaperSelectorLoader.active = false;
}
onWallpaperSettingsRequested: {
close();
homeScreen.openConfigure();
}
}
}
}

View file

@ -127,6 +127,10 @@ Item {
onClosed: {
wallpaperSelectorLoader.active = false;
}
onWallpaperSettingsRequested: {
close();
root.homeScreen.openContainmentSettings();
}
}
}
}