Mask the incoming wallpaper with its own layer effect
A MultiEffect pointed at a hidden source drew nothing, so the reveal was invisible and the wallpaper still cut over at the end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
728a9d336c
commit
f6732dc3da
1 file changed
+13
-13
@@ -1,3 +1,4 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
import Quickshell
|
import Quickshell
|
||||||
@@ -40,15 +41,6 @@ PanelWindow {
|
|||||||
// Drop the overlay only once the base layer shows the new image.
|
// Drop the overlay only once the base layer shows the new image.
|
||||||
onStatusChanged:root.settle()
|
onStatusChanged:root.settle()
|
||||||
}
|
}
|
||||||
Image {
|
|
||||||
id:incoming
|
|
||||||
anchors.fill:parent
|
|
||||||
visible:false
|
|
||||||
sourceSize:Qt.size(parent.width,parent.height)
|
|
||||||
asynchronous:true
|
|
||||||
fillMode:Image.PreserveAspectCrop
|
|
||||||
onStatusChanged:if(status===Image.Ready && source.toString())reveal.restart()
|
|
||||||
}
|
|
||||||
Item {
|
Item {
|
||||||
id:revealMask
|
id:revealMask
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
@@ -61,18 +53,26 @@ PanelWindow {
|
|||||||
color:"black"
|
color:"black"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MultiEffect {
|
// The mask must be the image's own layer effect: a MultiEffect pointed at a
|
||||||
|
// hidden source renders nothing here.
|
||||||
|
Image {
|
||||||
|
id:incoming
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
visible:root.transitioning
|
visible:root.transitioning && root.progress>0
|
||||||
source:incoming
|
sourceSize:Qt.size(parent.width,parent.height)
|
||||||
|
asynchronous:true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
// Settles from a slight zoom while the circle widens, like swww/awww "grow".
|
// Settles from a slight zoom while the circle widens, like swww/awww "grow".
|
||||||
scale:1.06-0.06*root.progress
|
scale:1.06-0.06*root.progress
|
||||||
opacity:Math.min(1,root.progress*4)
|
onStatusChanged:if(status===Image.Ready && source.toString())reveal.restart()
|
||||||
|
layer.enabled:root.transitioning
|
||||||
|
layer.effect:MultiEffect {
|
||||||
maskEnabled:true
|
maskEnabled:true
|
||||||
maskSource:revealMask
|
maskSource:revealMask
|
||||||
maskThresholdMin:0.5
|
maskThresholdMin:0.5
|
||||||
maskSpreadAtMin:1
|
maskSpreadAtMin:1
|
||||||
}
|
}
|
||||||
|
}
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id:reveal
|
id:reveal
|
||||||
target:root;property:"progress"
|
target:root;property:"progress"
|
||||||
|
|||||||
Reference in new issue
Block a user