forked from Shinonome/dots-hyprland
background: add fade when switching
This commit is contained in:
@@ -148,7 +148,11 @@ Variants {
|
|||||||
// Wallpaper
|
// Wallpaper
|
||||||
Image {
|
Image {
|
||||||
id: wallpaper
|
id: wallpaper
|
||||||
visible: !bgRoot.wallpaperIsVideo
|
visible: opacity > 0
|
||||||
|
opacity: (status === Image.Ready && !bgRoot.wallpaperIsVideo) ? 1 : 0
|
||||||
|
Behavior on opacity {
|
||||||
|
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
property real value // 0 to 1, for offset
|
property real value // 0 to 1, for offset
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
value: {
|
value: {
|
||||||
|
|||||||
@@ -63,13 +63,17 @@ Button {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
width: root.rowHeight * modelData.aspect_ratio
|
width: root.rowHeight * modelData.aspect_ratio
|
||||||
height: root.rowHeight
|
height: root.rowHeight
|
||||||
visible: opacity > 0
|
|
||||||
opacity: status === Image.Ready ? 1 : 0
|
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: modelData.preview_url
|
source: modelData.preview_url
|
||||||
sourceSize.width: root.rowHeight * modelData.aspect_ratio
|
sourceSize.width: root.rowHeight * modelData.aspect_ratio
|
||||||
sourceSize.height: root.rowHeight
|
sourceSize.height: root.rowHeight
|
||||||
|
|
||||||
|
visible: opacity > 0
|
||||||
|
opacity: status === Image.Ready ? 1 : 0
|
||||||
|
Behavior on opacity {
|
||||||
|
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: OpacityMask {
|
layer.effect: OpacityMask {
|
||||||
maskSource: Rectangle {
|
maskSource: Rectangle {
|
||||||
@@ -78,10 +82,6 @@ Button {
|
|||||||
radius: imageRadius
|
radius: imageRadius
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RippleButton {
|
RippleButton {
|
||||||
|
|||||||
Reference in New Issue
Block a user