mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +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
|
visible: Settings.privacyScreen
|
||||||
screenTimeout: Settings.privacyScreenTimeout
|
screenTimeout: Settings.privacyScreenTimeout
|
||||||
timelineRoot: adaptiveView
|
timelineRoot: adaptiveView
|
||||||
|
windowTarget: MainWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,11 @@ Item {
|
||||||
property var timelineRoot
|
property var timelineRoot
|
||||||
property int screenTimeout
|
property int screenTimeout
|
||||||
|
|
||||||
|
required property var windowTarget
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onActiveChanged() {
|
function onActiveChanged() {
|
||||||
if (MainWindow.active) {
|
if (windowTarget.active) {
|
||||||
screenSaverTimer.stop();
|
screenSaverTimer.stop();
|
||||||
screenSaver.state = "Invisible";
|
screenSaver.state = "Invisible";
|
||||||
} else {
|
} else {
|
||||||
|
@ -26,14 +28,14 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target: MainWindow
|
target: windowTarget
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: screenSaverTimer
|
id: screenSaverTimer
|
||||||
|
|
||||||
interval: screenTimeout * 1000
|
interval: screenTimeout * 1000
|
||||||
running: !MainWindow.active
|
running: !windowTarget.active
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
screenSaver.state = "Visible";
|
screenSaver.state = "Visible";
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,10 +92,19 @@ Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineView {
|
TimelineView {
|
||||||
|
id: timelineView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
room: roomWindowW.room
|
room: roomWindowW.room
|
||||||
roomPreview: roomWindowW.roomPreview.roomid ? roomWindowW.roomPreview : null
|
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