mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
settings: use Image for per-mode previews
This commit is contained in:
@@ -401,19 +401,25 @@ Item {
|
|||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceVariant
|
color: Theme.surfaceVariant
|
||||||
|
|
||||||
CachingImage {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 1
|
anchors.margins: 1
|
||||||
imagePath: {
|
source: {
|
||||||
var lightWallpaper = SessionData.wallpaperPathLight;
|
var wp = SessionData.wallpaperPathLight;
|
||||||
return (lightWallpaper !== "" && !lightWallpaper.startsWith("#")) ? lightWallpaper : "";
|
if (wp === "" || wp.startsWith("#"))
|
||||||
|
return "";
|
||||||
|
if (wp.startsWith("file://"))
|
||||||
|
wp = wp.substring(7);
|
||||||
|
return "file://" + wp.split('/').map(s => encodeURIComponent(s)).join('/');
|
||||||
}
|
}
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
visible: {
|
visible: {
|
||||||
var lightWallpaper = SessionData.wallpaperPathLight;
|
var lightWallpaper = SessionData.wallpaperPathLight;
|
||||||
return lightWallpaper !== "" && !lightWallpaper.startsWith("#");
|
return lightWallpaper !== "" && !lightWallpaper.startsWith("#");
|
||||||
}
|
}
|
||||||
maxCacheSize: 160
|
sourceSize.width: 160
|
||||||
|
sourceSize.height: 160
|
||||||
|
asynchronous: true
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
maskEnabled: true
|
maskEnabled: true
|
||||||
@@ -585,19 +591,25 @@ Item {
|
|||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceVariant
|
color: Theme.surfaceVariant
|
||||||
|
|
||||||
CachingImage {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 1
|
anchors.margins: 1
|
||||||
imagePath: {
|
source: {
|
||||||
var darkWallpaper = SessionData.wallpaperPathDark;
|
var wp = SessionData.wallpaperPathDark;
|
||||||
return (darkWallpaper !== "" && !darkWallpaper.startsWith("#")) ? darkWallpaper : "";
|
if (wp === "" || wp.startsWith("#"))
|
||||||
|
return "";
|
||||||
|
if (wp.startsWith("file://"))
|
||||||
|
wp = wp.substring(7);
|
||||||
|
return "file://" + wp.split('/').map(s => encodeURIComponent(s)).join('/');
|
||||||
}
|
}
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
visible: {
|
visible: {
|
||||||
var darkWallpaper = SessionData.wallpaperPathDark;
|
var darkWallpaper = SessionData.wallpaperPathDark;
|
||||||
return darkWallpaper !== "" && !darkWallpaper.startsWith("#");
|
return darkWallpaper !== "" && !darkWallpaper.startsWith("#");
|
||||||
}
|
}
|
||||||
maxCacheSize: 160
|
sourceSize.width: 160
|
||||||
|
sourceSize.height: 160
|
||||||
|
asynchronous: true
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
maskEnabled: true
|
maskEnabled: true
|
||||||
|
|||||||
Reference in New Issue
Block a user