Skip to content
Snippets Groups Projects
Commit 66d8a38c authored by Loren Burkholder's avatar Loren Burkholder
Browse files

Blurhash images when the privacy screen is active

parent 07707e15
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,7 @@ Rectangle { ...@@ -128,6 +128,7 @@ Rectangle {
TimelineView { TimelineView {
id: timeline id: timeline
privacyScreen: privacyScreen
showBackButton: adaptiveView.singlePageMode showBackButton: adaptiveView.singlePageMode
room: Rooms.currentRoom room: Rooms.currentRoom
roomPreview: Rooms.currentRoomPreview.roomid ? Rooms.currentRoomPreview : null roomPreview: Rooms.currentRoomPreview.roomid ? Rooms.currentRoomPreview : null
...@@ -140,6 +141,8 @@ Rectangle { ...@@ -140,6 +141,8 @@ Rectangle {
} }
PrivacyScreen { PrivacyScreen {
id: privacyScreen
anchors.fill: parent anchors.fill: parent
visible: Settings.privacyScreen visible: Settings.privacyScreen
screenTimeout: Settings.privacyScreenTimeout screenTimeout: Settings.privacyScreenTimeout
......
...@@ -12,6 +12,7 @@ import im.nheko 1.0 ...@@ -12,6 +12,7 @@ import im.nheko 1.0
Item { Item {
id: privacyScreen id: privacyScreen
readonly property bool active: screenSaver.state === "Visible"
property var timelineRoot property var timelineRoot
property int screenTimeout property int screenTimeout
...@@ -61,7 +62,6 @@ Item { ...@@ -61,7 +62,6 @@ Item {
target: screenSaver target: screenSaver
opacity: 1 opacity: 1
} }
}, },
State { State {
name: "Invisible" name: "Invisible"
...@@ -75,7 +75,6 @@ Item { ...@@ -75,7 +75,6 @@ Item {
target: screenSaver target: screenSaver
visible: false visible: false
} }
} }
] ]
transitions: [ transitions: [
......
...@@ -110,17 +110,21 @@ Page { ...@@ -110,17 +110,21 @@ Page {
} }
TimelineView { TimelineView {
id: timelineView id: timeline
privacyScreen: privacyScreen
anchors.fill: parent anchors.fill: parent
room: roomWindowW.room room: roomWindowW.room
roomPreview: roomWindowW.roomPreview.roomid ? roomWindowW.roomPreview : null roomPreview: roomWindowW.roomPreview.roomid ? roomWindowW.roomPreview : null
} }
PrivacyScreen { PrivacyScreen {
id: privacyScreen
anchors.fill: parent anchors.fill: parent
visible: Settings.privacyScreen visible: Settings.privacyScreen
screenTimeout: Settings.privacyScreenTimeout screenTimeout: Settings.privacyScreenTimeout
timelineRoot: timelineView timelineRoot: timeline
windowTarget: roomWindowW windowTarget: roomWindowW
} }
......
...@@ -26,6 +26,7 @@ Item { ...@@ -26,6 +26,7 @@ Item {
property var roomPreview: null property var roomPreview: null
property bool showBackButton: false property bool showBackButton: false
property bool shouldEffectsRun: false property bool shouldEffectsRun: false
required property PrivacyScreen privacyScreen
clip: true clip: true
onRoomChanged: if (room != null) room.triggerSpecialEffects() onRoomChanged: if (room != null) room.triggerSpecialEffects()
......
...@@ -31,18 +31,6 @@ AbstractButton { ...@@ -31,18 +31,6 @@ AbstractButton {
property int metadataWidth property int metadataWidth
property bool fitsMetadata: (parent.width - width) > metadataWidth+4 property bool fitsMetadata: (parent.width - width) > metadataWidth+4
Image {
id: blurhash_
anchors.fill: parent
visible: img.status != Image.Ready
source: blurhash ? ("image://blurhash/" + blurhash) : ("image://colorimage/:/icons/icons/ui/image-failed.svg?" + Nheko.colors.buttonText)
asynchronous: true
fillMode: Image.PreserveAspectFit
sourceSize.width: parent.width * Screen.devicePixelRatio
sourceSize.height: parent.height * Screen.devicePixelRatio
}
Image { Image {
id: img id: img
...@@ -68,7 +56,19 @@ AbstractButton { ...@@ -68,7 +56,19 @@ AbstractButton {
eventId: parent.eventId eventId: parent.eventId
} }
onClicked :Settings.openImageExternal ? room.openMedia(eventId) : TimelineManager.openImageOverlay(room, url, eventId, originalWidth, proportionalHeight); Image {
id: blurhash_
anchors.fill: parent
visible: img.status != Image.Ready || timeline.privacyScreen.active
source: blurhash ? ("image://blurhash/" + blurhash) : ("image://colorimage/:/icons/icons/ui/image-failed.svg?" + Nheko.colors.buttonText)
asynchronous: true
fillMode: Image.PreserveAspectFit
sourceSize.width: parent.width * Screen.devicePixelRatio
sourceSize.height: parent.height * Screen.devicePixelRatio
}
onClicked: Settings.openImageExternal ? room.openMedia(eventId) : TimelineManager.openImageOverlay(room, url, eventId, originalWidth, proportionalHeight);
Item { Item {
id: overlay id: overlay
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment