mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
Fade in images when fully recieved
This commit is contained in:
parent
2b8cadaac8
commit
5abd2df9b4
2 changed files with 8 additions and 27 deletions
|
@ -12,7 +12,7 @@ import im.nheko 1.0
|
||||||
Item {
|
Item {
|
||||||
id: privacyScreen
|
id: privacyScreen
|
||||||
|
|
||||||
readonly property bool active: screenSaver.state === "Visible"
|
readonly property bool active: Settings.privacyScreen && screenSaver.state === "Visible"
|
||||||
property var timelineRoot
|
property var timelineRoot
|
||||||
property int screenTimeout
|
property int screenTimeout
|
||||||
|
|
||||||
|
|
|
@ -28,15 +28,15 @@ AbstractButton {
|
||||||
height: width*proportionalHeight
|
height: width*proportionalHeight
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
state: img.status != Image.Ready ? "ImageLoading" : (timeline.privacyScreen.active ? "PrivacyScreenVisible" : "PrivacyScreenInvisible")
|
state: (img.status != Image.Ready || timeline.privacyScreen.active) ? "BlurhashVisible" : "ImageVisible"
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "ImageLoading"
|
name: "BlurhashVisible"
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: blurhash_
|
target: blurhash_
|
||||||
opacity: 1
|
opacity: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) ? 1 : 0
|
||||||
visible: true
|
visible: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash)
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
|
@ -50,26 +50,7 @@ AbstractButton {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "PrivacyScreenVisible"
|
name: "ImageVisible"
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
target: blurhash_
|
|
||||||
opacity: blurhash ? 1 : 0
|
|
||||||
visible: blurhash ? true : false
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
target: img
|
|
||||||
opacity: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
target: mxcimage
|
|
||||||
opacity: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "PrivacyScreenInvisible"
|
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: blurhash_
|
target: blurhash_
|
||||||
|
@ -90,8 +71,8 @@ AbstractButton {
|
||||||
]
|
]
|
||||||
transitions: [
|
transitions: [
|
||||||
Transition {
|
Transition {
|
||||||
from: "PrivacyScreenInvisible"
|
from: "ImageVisible"
|
||||||
to: "PrivacyScreenVisible"
|
to: "BlurhashVisible"
|
||||||
reversible: true
|
reversible: true
|
||||||
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
|
|
Loading…
Reference in a new issue