1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-08 06:25:37 -05:00

wallpaper: support different fill modes

This commit is contained in:
bbedward
2025-10-19 12:49:57 -04:00
parent e1c180a13f
commit 64960e4dcd
17 changed files with 368 additions and 207 deletions

View File

@@ -410,6 +410,56 @@ Item {
}
}
Item {
width: parent.width
height: fillModeGroup.height
visible: {
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath
return currentWallpaper !== "" && !currentWallpaper.startsWith("#")
}
DankButtonGroup {
id: fillModeGroup
anchors.horizontalCenter: parent.horizontalCenter
model: ["Stretch", "Fit", "Fill", "Tile", "Tile V", "Tile H", "Pad"]
selectionMode: "single"
buttonHeight: 28
minButtonWidth: 48
buttonPadding: Theme.spacingS
checkIconSize: 0
textSize: Theme.fontSizeSmall
checkEnabled: false
currentIndex: {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
return modes.indexOf(SettingsData.wallpaperFillMode)
}
onSelectionChanged: (index, selected) => {
if (selected) {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
SettingsData.setWallpaperFillMode(modes[index])
}
}
Connections {
target: SettingsData
function onWallpaperFillModeChanged() {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
fillModeGroup.currentIndex = modes.indexOf(SettingsData.wallpaperFillMode)
}
}
Connections {
target: personalizationTab
function onSelectedMonitorNameChanged() {
Qt.callLater(() => {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
fillModeGroup.currentIndex = modes.indexOf(SettingsData.wallpaperFillMode)
})
}
}
}
}
// Per-Mode Wallpaper Section - Full Width
Rectangle {
width: parent.width