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:
@@ -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
|
||||
|
||||
@@ -173,7 +173,7 @@ Item {
|
||||
}
|
||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||
}
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
|
||||
smooth: true
|
||||
asynchronous: false
|
||||
cache: true
|
||||
|
||||
@@ -139,7 +139,7 @@ Item {
|
||||
}
|
||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||
}
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
|
||||
smooth: true
|
||||
asynchronous: false
|
||||
cache: true
|
||||
|
||||
Reference in New Issue
Block a user