mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-21 18:50:47 +03:00
Blurhash images when the privacy screen is active
This commit is contained in:
parent
07707e1558
commit
66d8a38c80
5 changed files with 24 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue