mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-21 18:50:47 +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 {
|
||||
id: privacyScreen
|
||||
|
||||
readonly property bool active: screenSaver.state === "Visible"
|
||||
readonly property bool active: Settings.privacyScreen && screenSaver.state === "Visible"
|
||||
property var timelineRoot
|
||||
property int screenTimeout
|
||||
|
||||
|
|
|
@ -28,15 +28,15 @@ AbstractButton {
|
|||
height: width*proportionalHeight
|
||||
hoverEnabled: true
|
||||
|
||||
state: img.status != Image.Ready ? "ImageLoading" : (timeline.privacyScreen.active ? "PrivacyScreenVisible" : "PrivacyScreenInvisible")
|
||||
state: (img.status != Image.Ready || timeline.privacyScreen.active) ? "BlurhashVisible" : "ImageVisible"
|
||||
states: [
|
||||
State {
|
||||
name: "ImageLoading"
|
||||
name: "BlurhashVisible"
|
||||
|
||||
PropertyChanges {
|
||||
target: blurhash_
|
||||
opacity: 1
|
||||
visible: true
|
||||
opacity: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) ? 1 : 0
|
||||
visible: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash)
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
|
@ -50,26 +50,7 @@ AbstractButton {
|
|||
}
|
||||
},
|
||||
State {
|
||||
name: "PrivacyScreenVisible"
|
||||
|
||||
PropertyChanges {
|
||||
target: blurhash_
|
||||
opacity: blurhash ? 1 : 0
|
||||
visible: blurhash ? true : false
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: img
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: mxcimage
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "PrivacyScreenInvisible"
|
||||
name: "ImageVisible"
|
||||
|
||||
PropertyChanges {
|
||||
target: blurhash_
|
||||
|
@ -90,8 +71,8 @@ AbstractButton {
|
|||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "PrivacyScreenInvisible"
|
||||
to: "PrivacyScreenVisible"
|
||||
from: "ImageVisible"
|
||||
to: "BlurhashVisible"
|
||||
reversible: true
|
||||
|
||||
SequentialAnimation {
|
||||
|
|
Loading…
Reference in a new issue