diff --git a/resources/qml/ChatPage.qml b/resources/qml/ChatPage.qml index 3d76616a3b264be23c95bbf3cf16b7e0109d0e13..2c0f988fe6fc28a35c1597fcd49eeebf8063d619 100644 --- a/resources/qml/ChatPage.qml +++ b/resources/qml/ChatPage.qml @@ -128,6 +128,7 @@ Rectangle { TimelineView { id: timeline + privacyScreen: privacyScreen showBackButton: adaptiveView.singlePageMode room: Rooms.currentRoom roomPreview: Rooms.currentRoomPreview.roomid ? Rooms.currentRoomPreview : null @@ -140,6 +141,8 @@ Rectangle { } PrivacyScreen { + id: privacyScreen + anchors.fill: parent visible: Settings.privacyScreen screenTimeout: Settings.privacyScreenTimeout diff --git a/resources/qml/PrivacyScreen.qml b/resources/qml/PrivacyScreen.qml index bc1283026d9a87bf22f517385240cc92706746e9..11ab27bd2ce22433ba2eb41fa68e3d4210f875e9 100644 --- a/resources/qml/PrivacyScreen.qml +++ b/resources/qml/PrivacyScreen.qml @@ -12,6 +12,7 @@ import im.nheko 1.0 Item { id: privacyScreen + readonly property bool active: screenSaver.state === "Visible" property var timelineRoot property int screenTimeout @@ -61,7 +62,6 @@ Item { target: screenSaver opacity: 1 } - }, State { name: "Invisible" @@ -75,7 +75,6 @@ Item { target: screenSaver visible: false } - } ] transitions: [ diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index f06fb15e46c729f9c154e9584dcfe8025ae5ec6a..7dc89cc96dde724cb95043521b91e68acb99ab1d 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -110,17 +110,21 @@ Page { } TimelineView { - id: timelineView + id: timeline + + privacyScreen: privacyScreen anchors.fill: parent room: roomWindowW.room roomPreview: roomWindowW.roomPreview.roomid ? roomWindowW.roomPreview : null } PrivacyScreen { + id: privacyScreen + anchors.fill: parent visible: Settings.privacyScreen screenTimeout: Settings.privacyScreenTimeout - timelineRoot: timelineView + timelineRoot: timeline windowTarget: roomWindowW } diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 0d47746c2d94276e783d08c018f060565cfa4491..9124c1583c7c39f92ce0070eb18c3db12f8315a7 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -26,6 +26,7 @@ Item { property var roomPreview: null property bool showBackButton: false property bool shouldEffectsRun: false + required property PrivacyScreen privacyScreen clip: true onRoomChanged: if (room != null) room.triggerSpecialEffects() diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml index af69b9837106f628a994b90381371acb5bb5c586..bb22d0ee618cf0d17b951af022ddf6181937f3d3 100644 --- a/resources/qml/delegates/ImageMessage.qml +++ b/resources/qml/delegates/ImageMessage.qml @@ -31,18 +31,6 @@ AbstractButton { property int metadataWidth 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 { id: img @@ -68,7 +56,19 @@ AbstractButton { 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 { id: overlay