mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-01 01:07:33 +00:00
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:
parent
1fc13f6d0f
commit
56ca0db5c6
3 changed files with 50 additions and 9 deletions
|
|
@ -18,6 +18,8 @@ Controls.Drawer {
|
||||||
|
|
||||||
required property bool horizontal
|
required property bool horizontal
|
||||||
|
|
||||||
|
signal wallpaperSettingsRequested()
|
||||||
|
|
||||||
onOpened: {
|
onOpened: {
|
||||||
wallpapersView.forceActiveFocus()
|
wallpapersView.forceActiveFocus()
|
||||||
}
|
}
|
||||||
|
|
@ -45,7 +47,37 @@ Controls.Drawer {
|
||||||
snapMode: ListView.SnapToItem
|
snapMode: ListView.SnapToItem
|
||||||
model: imageWallpaper.wallpaperModel
|
model: imageWallpaper.wallpaperModel
|
||||||
// onCountChanged: currentIndex = Math.min(model.indexOf(configDialog.wallpaperConfiguration["Image"]), model.rowCount()-1)
|
// 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 {
|
delegate: Controls.ItemDelegate {
|
||||||
width: imageWallpaperDrawer.horizontal ? parent.width : height * (imageWallpaperDrawer.width / imageWallpaperDrawer.Screen.height)
|
width: imageWallpaperDrawer.horizontal ? parent.width : height * (imageWallpaperDrawer.width / imageWallpaperDrawer.Screen.height)
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,11 @@ Item {
|
||||||
onClosed: {
|
onClosed: {
|
||||||
wallpaperSelectorLoader.active = false;
|
wallpaperSelectorLoader.active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onWallpaperSettingsRequested: {
|
||||||
|
close();
|
||||||
|
homeScreen.openConfigure();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,10 @@ Item {
|
||||||
onClosed: {
|
onClosed: {
|
||||||
wallpaperSelectorLoader.active = false;
|
wallpaperSelectorLoader.active = false;
|
||||||
}
|
}
|
||||||
|
onWallpaperSettingsRequested: {
|
||||||
|
close();
|
||||||
|
root.homeScreen.openContainmentSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue