Verified Commit 2339ea9b authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/image: force reload wallpaper after target size changes

When the target size changes while the provider type is single image
or the current wallpaper is animated, the frontend is required to force
update the wallpaper.
parent 52393639
Pipeline #197560 passed with stage
in 8 minutes and 5 seconds
......@@ -89,6 +89,7 @@ QQC2.StackView {
}
targetSize: root.sourceSize
onActualSizeChanged: Qt.callLater(loadImage);
onColorSchemeChanged: loadImageImmediately();
}
......
......@@ -91,8 +91,13 @@ void MediaProxy::setTargetSize(const QSize &size)
Q_EMIT targetSizeChanged(size);
if (m_providerType == Provider::Type::Package) {
determineBackgroundType(); // In case file format changes after size changes
updateModelImage();
}
if (m_providerType == Provider::Type::Image || m_backgroundType == BackgroundType::Type::AnimatedImage) {
// When KPackage contains animated wallpapers, image provider is not used.
Q_EMIT actualSizeChanged();
}
}
Provider::Type MediaProxy::providerType() const
......
......@@ -77,6 +77,13 @@ Q_SIGNALS:
void targetSizeChanged(const QSize &size);
/**
* Emitted when the target size changes while the provider type is single image
* or the current wallpaper is animated.
* The frontend is required to force update the wallpaper.
*/
void actualSizeChanged();
/**
* Emitted when system color scheme changes. The frontend is required to
* reload the wallpaper even if the image path is not changed.
......
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