diff options
author | Loren Burkholder <computersemiexpert@outlook.com> | 2023-02-22 20:16:55 -0500 |
---|---|---|
committer | Loren Burkholder <computersemiexpert@outlook.com> | 2023-02-22 20:25:45 -0500 |
commit | 5abd2df9b422a6e0c28e748c309b9857d1a65c2f (patch) | |
tree | 9e832f96bb3d1337583e9751a0e6e7b60d1912b3 /resources/qml | |
parent | Properly handle images without blurhashes (diff) | |
download | nheko-5abd2df9b422a6e0c28e748c309b9857d1a65c2f.tar.xz |
Fade in images when fully recieved
Diffstat (limited to 'resources/qml')
-rw-r--r-- | resources/qml/PrivacyScreen.qml | 2 | ||||
-rw-r--r-- | resources/qml/delegates/ImageMessage.qml | 33 |
2 files changed, 8 insertions, 27 deletions
diff --git a/resources/qml/PrivacyScreen.qml b/resources/qml/PrivacyScreen.qml index e501d6ab..3edf0d86 100644 --- a/resources/qml/PrivacyScreen.qml +++ b/resources/qml/PrivacyScreen.qml @@ -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 diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml index 509e80a6..f2811869 100644 --- a/resources/qml/delegates/ImageMessage.qml +++ b/resources/qml/delegates/ImageMessage.qml @@ -28,34 +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 - } - - PropertyChanges { - target: img - opacity: 0 - } - - PropertyChanges { - target: mxcimage - opacity: 0 - } - }, - State { - name: "PrivacyScreenVisible" - - PropertyChanges { - target: blurhash_ - opacity: blurhash ? 1 : 0 - visible: blurhash ? true : false + opacity: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) ? 1 : 0 + visible: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) } PropertyChanges { @@ -69,7 +50,7 @@ AbstractButton { } }, 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 { |