mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Make PrivacyScreen work on Popped-out Rooms
This commit is contained in:
parent
d130c96160
commit
7f2ae13c43
3 changed files with 15 additions and 3 deletions
|
@ -143,6 +143,7 @@ Rectangle {
|
|||
visible: Settings.privacyScreen
|
||||
screenTimeout: Settings.privacyScreenTimeout
|
||||
timelineRoot: adaptiveView
|
||||
windowTarget: MainWindow
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue