mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -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 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) {
|
function snap(value, dpr) {
|
||||||
const s = dpr || 1
|
const s = dpr || 1
|
||||||
return Math.round(value * s) / s
|
return Math.round(value * s) / s
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ Item {
|
|||||||
}
|
}
|
||||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||||
}
|
}
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
|
||||||
smooth: true
|
smooth: true
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
cache: true
|
cache: true
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ Item {
|
|||||||
}
|
}
|
||||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||||
}
|
}
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
|
||||||
smooth: true
|
smooth: true
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
cache: true
|
cache: true
|
||||||
|
|||||||
Reference in New Issue
Block a user