mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
widgets: set updatesEnabled false on background layers, if qs supports
it
This commit is contained in:
@@ -87,19 +87,47 @@ Variants {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (!source) {
|
if (!source) {
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
|
updatesBindingTimer.start();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
|
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
|
||||||
setWallpaperImmediate(formattedSource);
|
setWallpaperImmediate(formattedSource);
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
|
updatesBindingTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool isInitialized: false
|
property bool isInitialized: false
|
||||||
property real transitionProgress: 0
|
property real transitionProgress: 0
|
||||||
readonly property bool transitioning: transitionAnimation.running
|
readonly property bool transitioning: transitionAnimation.running
|
||||||
property bool effectActive: false
|
property bool effectActive: false
|
||||||
|
property bool _renderSettling: false
|
||||||
property bool useNextForEffect: false
|
property bool useNextForEffect: false
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: currentWallpaper
|
||||||
|
function onStatusChanged() {
|
||||||
|
if (currentWallpaper.status === Image.Ready) {
|
||||||
|
root._renderSettling = true;
|
||||||
|
renderSettleTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: renderSettleTimer
|
||||||
|
interval: 100
|
||||||
|
onTriggered: root._renderSettling = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: updatesBindingTimer
|
||||||
|
interval: 500
|
||||||
|
onTriggered: {
|
||||||
|
if (typeof blurWallpaperWindow.updatesEnabled !== "undefined")
|
||||||
|
blurWallpaperWindow.updatesEnabled = Qt.binding(() => root.effectActive || root._renderSettling || currentWallpaper.status === Image.Loading || nextWallpaper.status === Image.Loading);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
if (!source || source.startsWith("#")) {
|
if (!source || source.startsWith("#")) {
|
||||||
setWallpaperImmediate("");
|
setWallpaperImmediate("");
|
||||||
@@ -124,6 +152,8 @@ Variants {
|
|||||||
transitionAnimation.stop();
|
transitionAnimation.stop();
|
||||||
root.transitionProgress = 0.0;
|
root.transitionProgress = 0.0;
|
||||||
root.effectActive = false;
|
root.effectActive = false;
|
||||||
|
root._renderSettling = true;
|
||||||
|
renderSettleTimer.restart();
|
||||||
currentWallpaper.source = newSource;
|
currentWallpaper.source = newSource;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,9 +83,35 @@ Variants {
|
|||||||
|
|
||||||
readonly property bool transitioning: transitionAnimation.running
|
readonly property bool transitioning: transitionAnimation.running
|
||||||
property bool effectActive: false
|
property bool effectActive: false
|
||||||
|
property bool _renderSettling: false
|
||||||
property bool useNextForEffect: false
|
property bool useNextForEffect: false
|
||||||
property string pendingWallpaper: ""
|
property string pendingWallpaper: ""
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: currentWallpaper
|
||||||
|
function onStatusChanged() {
|
||||||
|
if (currentWallpaper.status === Image.Ready) {
|
||||||
|
root._renderSettling = true;
|
||||||
|
renderSettleTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: renderSettleTimer
|
||||||
|
interval: 100
|
||||||
|
onTriggered: root._renderSettling = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: updatesBindingTimer
|
||||||
|
interval: 500
|
||||||
|
onTriggered: {
|
||||||
|
if (typeof wallpaperWindow.updatesEnabled !== "undefined")
|
||||||
|
wallpaperWindow.updatesEnabled = Qt.binding(() => root.effectActive || root._renderSettling || currentWallpaper.status === Image.Loading || nextWallpaper.status === Image.Loading);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getFillMode(modeName) {
|
function getFillMode(modeName) {
|
||||||
switch (modeName) {
|
switch (modeName) {
|
||||||
case "Stretch":
|
case "Stretch":
|
||||||
@@ -112,11 +138,13 @@ Variants {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (!source) {
|
if (!source) {
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
|
updatesBindingTimer.start();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
|
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
|
||||||
setWallpaperImmediate(formattedSource);
|
setWallpaperImmediate(formattedSource);
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
|
updatesBindingTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
@@ -143,6 +171,8 @@ Variants {
|
|||||||
transitionAnimation.stop();
|
transitionAnimation.stop();
|
||||||
root.transitionProgress = 0.0;
|
root.transitionProgress = 0.0;
|
||||||
root.effectActive = false;
|
root.effectActive = false;
|
||||||
|
root._renderSettling = true;
|
||||||
|
renderSettleTimer.restart();
|
||||||
currentWallpaper.source = newSource;
|
currentWallpaper.source = newSource;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,6 +288,10 @@ Item {
|
|||||||
screen: root.screen
|
screen: root.screen
|
||||||
visible: false
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (typeof updatesEnabled !== "undefined")
|
||||||
|
updatesEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
WlrLayershell.namespace: root.layerNamespace + ":background"
|
WlrLayershell.namespace: root.layerNamespace + ":background"
|
||||||
WlrLayershell.layer: WlrLayershell.Top
|
WlrLayershell.layer: WlrLayershell.Top
|
||||||
|
|||||||
Reference in New Issue
Block a user