summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-02-03 03:12:08 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-02-03 03:14:43 +0100
commit3433cc3be7d0e9038017f3d1e2ecd53e830b6073 (patch)
treef0857806c4d860ae966f1be8a9109724eb908798
parentMerge pull request #446 from LorenDB/master (diff)
downloadnheko-3433cc3be7d0e9038017f3d1e2ecd53e830b6073.tar.xz
Cleanup privacy screen, no more grabImage
-rw-r--r--resources/qml/MessageInput.qml1
-rw-r--r--resources/qml/PrivacyScreen.qml33
-rw-r--r--resources/qml/TimelineView.qml14
3 files changed, 13 insertions, 35 deletions
diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml

index 4c73f28b..5d335872 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml
@@ -273,6 +273,7 @@ Rectangle { cursorShape: Qt.IBeamCursor onClicked: TimelineManager.timeline.input.paste(true) } + } ScrollBar.vertical: ScrollBar { diff --git a/resources/qml/PrivacyScreen.qml b/resources/qml/PrivacyScreen.qml
index 2cfae471..76520706 100644 --- a/resources/qml/PrivacyScreen.qml +++ b/resources/qml/PrivacyScreen.qml
@@ -6,11 +6,8 @@ Item { id: privacyScreen property var timelineRoot - property var imageSource: "" property int screenTimeout - anchors.fill: parent - Connections { target: TimelineManager onFocusChanged: { @@ -31,22 +28,16 @@ Item { interval: screenTimeout * 1000 running: true onTriggered: { - if (MainWindow.visible) - timelineRoot.grabToImage(function(result) { - screenSaver.state = "Visible"; - imageSource = result.url; - }, Qt.size(width, height)); - + screenSaver.state = "Visible"; } } - Rectangle { + Item { id: screenSaver state: "Invisible" anchors.fill: parent visible: false - color: "transparent" states: [ State { name: "Visible" @@ -122,27 +113,11 @@ Item { } ] - Image { - id: image - - cache: false - anchors.fill: parent - source: imageSource - } - - ShaderEffectSource { - id: effectSource - - sourceItem: image - anchors.fill: image - sourceRect: Qt.rect(0, 0, width, height) - } - FastBlur { id: blur - anchors.fill: effectSource - source: effectSource + anchors.fill: parent + source: timelineRoot radius: 50 } diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 9fa2139e..c03e8d31 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml
@@ -277,19 +277,21 @@ Page { MessageInput { } + } NhekoDropArea { - anchors.fill: timelineLayout + anchors.fill: parent roomid: TimelineManager.timeline ? TimelineManager.timeline.roomId() : "" } - PrivacyScreen { - visible: Settings.privacyScreen - screenTimeout: Settings.privacyScreenTimeout - timelineRoot: timelineRoot - } + } + PrivacyScreen { + anchors.fill: parent + visible: Settings.privacyScreen + screenTimeout: Settings.privacyScreenTimeout + timelineRoot: timelineLayout } systemInactive: SystemPalette {