Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/main.qml
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 55 | if (modelImage != configuredImage && configuredImage != "") { | |||
---|---|---|---|---|---|
56 | imageWallpaper.addUrl(configuredImage); | 56 | imageWallpaper.addUrl(configuredImage); | ||
57 | } | 57 | } | ||
58 | } | 58 | } | ||
59 | Component.onCompleted: { | 59 | Component.onCompleted: { | ||
60 | if (wallpaper.pluginName === "org.kde.slideshow") { | 60 | if (wallpaper.pluginName === "org.kde.slideshow") { | ||
61 | wallpaper.setAction("open", i18nd("plasma_wallpaper_org.kde.image", "Open Wallpaper Image"), "document-open"); | 61 | wallpaper.setAction("open", i18nd("plasma_wallpaper_org.kde.image", "Open Wallpaper Image"), "document-open"); | ||
62 | wallpaper.setAction("next", i18nd("plasma_wallpaper_org.kde.image", "Next Wallpaper Image"), "user-desktop"); | 62 | wallpaper.setAction("next", i18nd("plasma_wallpaper_org.kde.image", "Next Wallpaper Image"), "user-desktop"); | ||
63 | } | 63 | } | ||
64 | wallpaper.loading = true; | ||||
64 | } | 65 | } | ||
65 | 66 | | |||
66 | Wallpaper.Image { | 67 | Wallpaper.Image { | ||
67 | id: imageWallpaper | 68 | id: imageWallpaper | ||
68 | //the oneliner of difference between image and slideshow wallpapers | 69 | //the oneliner of difference between image and slideshow wallpapers | ||
69 | renderingMode: (wallpaper.pluginName === "org.kde.image") ? Wallpaper.Image.SingleImage : Wallpaper.Image.SlideShow | 70 | renderingMode: (wallpaper.pluginName === "org.kde.image") ? Wallpaper.Image.SingleImage : Wallpaper.Image.SlideShow | ||
70 | targetSize: root.sourceSize | 71 | targetSize: root.sourceSize | ||
71 | slidePaths: wallpaper.configuration.SlidePaths | 72 | slidePaths: wallpaper.configuration.SlidePaths | ||
Show All 21 Lines | 90 | var pendingImage = baseImage.createObject(root, { "source": root.modelImage, | |||
93 | "blur": root.blur, | 94 | "blur": root.blur, | ||
94 | "opacity": isFirst ? 1: 0}); | 95 | "opacity": isFirst ? 1: 0}); | ||
95 | 96 | | |||
96 | function replaceWhenLoaded() { | 97 | function replaceWhenLoaded() { | ||
97 | if (pendingImage.status !== Image.Loading) { | 98 | if (pendingImage.status !== Image.Loading) { | ||
98 | root.replace(pendingImage, {}, | 99 | root.replace(pendingImage, {}, | ||
99 | isFirst ? QQC2.StackView.Immediate : QQC2.StackView.Transition);//dont' animate first show | 100 | isFirst ? QQC2.StackView.Immediate : QQC2.StackView.Transition);//dont' animate first show | ||
100 | pendingImage.statusChanged.disconnect(replaceWhenLoaded); | 101 | pendingImage.statusChanged.disconnect(replaceWhenLoaded); | ||
102 | wallpaper.loading = false; | ||||
101 | } | 103 | } | ||
102 | } | 104 | } | ||
103 | pendingImage.statusChanged.connect(replaceWhenLoaded); | 105 | pendingImage.statusChanged.connect(replaceWhenLoaded); | ||
104 | replaceWhenLoaded(); | 106 | replaceWhenLoaded(); | ||
105 | } | 107 | } | ||
106 | 108 | | |||
107 | Component { | 109 | Component { | ||
108 | id: baseImage | 110 | id: baseImage | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |