summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2022-05-12 14:56:22 -0400
committerJoseph Donofry <joedonofry@gmail.com>2022-05-12 14:56:22 -0400
commit7f2ae13c4353161767f6204f26de18fad0349392 (patch)
treeb89ab3a0826d8883af2e3da176ddde8f13cf684a /resources/qml
parentFix PrivacyScreen for MainWindow (diff)
downloadnheko-7f2ae13c4353161767f6204f26de18fad0349392.tar.xz
Make PrivacyScreen work on Popped-out Rooms
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/ChatPage.qml1
-rw-r--r--resources/qml/PrivacyScreen.qml8
-rw-r--r--resources/qml/RoomList.qml9
3 files changed, 15 insertions, 3 deletions
diff --git a/resources/qml/ChatPage.qml b/resources/qml/ChatPage.qml
index c39f442e..cc62d501 100644
--- a/resources/qml/ChatPage.qml
+++ b/resources/qml/ChatPage.qml
@@ -143,6 +143,7 @@ Rectangle {
         visible: Settings.privacyScreen
         screenTimeout: Settings.privacyScreenTimeout
         timelineRoot: adaptiveView
+        windowTarget: MainWindow
     }
 
 }
diff --git a/resources/qml/PrivacyScreen.qml b/resources/qml/PrivacyScreen.qml
index d312172e..f91e4a73 100644
--- a/resources/qml/PrivacyScreen.qml
+++ b/resources/qml/PrivacyScreen.qml
@@ -14,9 +14,11 @@ Item {
     property var timelineRoot
     property int screenTimeout
 
+    required property var windowTarget
+
     Connections {
         function onActiveChanged() {
-            if (MainWindow.active) {
+            if (windowTarget.active) {
                 screenSaverTimer.stop();
                 screenSaver.state = "Invisible";
             } else {
@@ -26,14 +28,14 @@ Item {
             }
         }
 
-        target: MainWindow
+        target: windowTarget
     }
 
     Timer {
         id: screenSaverTimer
 
         interval: screenTimeout * 1000
-        running: !MainWindow.active
+        running: !windowTarget.active
         onTriggered: {
             screenSaver.state = "Visible";
         }
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index 52370746..69e12907 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -92,10 +92,19 @@ Page {
                 }
 
                 TimelineView {
+                    id: timelineView
                     anchors.fill: parent
                     room: roomWindowW.room
                     roomPreview: roomWindowW.roomPreview.roomid ? roomWindowW.roomPreview : null
                 }
+
+                PrivacyScreen {
+                    anchors.fill: parent
+                    visible: Settings.privacyScreen
+                    screenTimeout: Settings.privacyScreenTimeout
+                    timelineRoot: timelineView
+                    windowTarget: roomWindowW
+                }
             }
 
         }