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

wallpaper: respect fill mode on lock + greeter

This commit is contained in:
bbedward
2025-10-19 23:39:21 -04:00
parent 0cb081a6d0
commit ad778b5d81
3 changed files with 17 additions and 2 deletions

View File

@@ -816,6 +816,21 @@ Singleton {
function withAlpha(c, a) { return Qt.rgba(c.r, c.g, c.b, a); }
function getFillMode(modeName) {
switch(modeName) {
case "Stretch": return Image.Stretch
case "Fit":
case "PreserveAspectFit": return Image.PreserveAspectFit
case "Fill":
case "PreserveAspectCrop": return Image.PreserveAspectCrop
case "Tile": return Image.Tile
case "TileVertically": return Image.TileVertically
case "TileHorizontally": return Image.TileHorizontally
case "Pad": return Image.Pad
default: return Image.PreserveAspectCrop
}
}
function snap(value, dpr) {
const s = dpr || 1
return Math.round(value * s) / s

View File

@@ -173,7 +173,7 @@ Item {
}
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
}
fillMode: Image.PreserveAspectCrop
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
smooth: true
asynchronous: false
cache: true

View File

@@ -139,7 +139,7 @@ Item {
}
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
}
fillMode: Image.PreserveAspectCrop
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
smooth: true
asynchronous: false
cache: true