Commit 18069a0f authored by Fushan Wen's avatar Fushan Wen 💬 Committed by Nate Graham
Browse files

wallpapers/image: click image to preview

FEATURE: 403384
FIXED-IN: 5.26
parent e2244b63
Pipeline #184554 passed with stage
in 8 minutes and 21 seconds
......@@ -22,6 +22,10 @@
<label>Wallpaper image path or wallpaper name</label>
<default></default>
</entry>
<entry name="PreviewImage" type="String">
<label>Wallpaper preview image path</label>
<default>null</default>
</entry>
<entry name="FillMode" type="int">
<label>Sizing, cropping and positioning of the wallpaper image</label>
<default>2</default>
......
......@@ -119,6 +119,7 @@ KCM.GridDelegate {
onClicked: {
if (configDialog.currentWallpaper == "org.kde.image") {
cfg_Image = model.packageName || model.path;
wallpaper.configuration.PreviewImage = cfg_Image;
}
GridView.currentIndex = index;
}
......
......@@ -208,4 +208,8 @@ ColumnLayout {
viewMode: NewStuff.Page.ViewMode.Preview
}
}
Component.onDestruction: {
wallpaper.configuration.PreviewImage = "null";
}
}
......@@ -53,6 +53,8 @@ QQC2.StackView {
//private
Component.onCompleted: {
// In case plasmashell crashes when the config dialog is opened
wallpaper.configuration.PreviewImage = "null";
wallpaper.loading = true; // delays ksplash until the wallpaper has been loaded
if (wallpaper.pluginName === "org.kde.slideshow") {
......@@ -66,7 +68,15 @@ QQC2.StackView {
usedInConfig: false
//the oneliner of difference between image and slideshow wallpapers
renderingMode: (wallpaper.pluginName === "org.kde.image") ? Wallpaper.ImageBackend.SingleImage : Wallpaper.ImageBackend.SlideShow
image: wallpaper.pluginName === "org.kde.image" ? wallpaper.configuration.Image : ""
image: {
if (wallpaper.pluginName !== "org.kde.image") {
return "";
}
if (wallpaper.configuration.PreviewImage !== "null") {
return wallpaper.configuration.PreviewImage;
}
return wallpaper.configuration.Image;
}
targetSize: root.sourceSize
slidePaths: wallpaper.configuration.SlidePaths
slideTimer: wallpaper.configuration.SlideInterval
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment