matrixion/qml/voip/ScreenShare.qml

137 lines
4.2 KiB
QML
Raw Permalink Normal View History

2021-03-05 02:35:15 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
// SPDX-FileCopyrightText: 2022 Nheko Contributors
2021-03-05 02:35:15 +03:00
// SPDX-License-Identifier: GPL-3.0-or-later
2021-02-18 23:55:29 +03:00
import "../"
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import im.nheko
2021-02-18 23:55:29 +03:00
Popup {
2022-04-16 03:13:01 +03:00
anchors.centerIn: parent
2021-02-18 23:55:29 +03:00
modal: true
2022-04-16 03:13:01 +03:00
palette: timelineRoot.palette
2021-02-18 23:55:29 +03:00
2022-04-16 03:13:01 +03:00
background: Rectangle {
border.color: timelineRoot.palette.windowText
color: timelineRoot.palette.window
}
Component.onCompleted: {
2021-02-18 23:55:29 +03:00
frameRateCombo.currentIndex = frameRateCombo.find(Settings.screenShareFrameRate);
}
ColumnLayout {
Label {
2022-04-16 03:13:01 +03:00
Layout.alignment: Qt.AlignLeft
2021-02-22 00:30:10 +03:00
Layout.bottomMargin: 16
Layout.leftMargin: 8
Layout.rightMargin: 8
2022-04-16 03:13:01 +03:00
Layout.topMargin: 16
2022-04-11 05:18:16 +03:00
color: timelineRoot.palette.windowText
2022-04-16 03:13:01 +03:00
text: qsTr("Share desktop with %1?").arg(room.roomName)
2021-02-18 23:55:29 +03:00
}
RowLayout {
2022-04-16 03:13:01 +03:00
Layout.bottomMargin: 8
2021-02-18 23:55:29 +03:00
Layout.leftMargin: 8
Layout.rightMargin: 8
Label {
Layout.alignment: Qt.AlignLeft
2022-04-11 05:18:16 +03:00
color: timelineRoot.palette.windowText
2022-04-16 03:13:01 +03:00
text: qsTr("Window:")
}
ComboBox {
id: windowCombo
Layout.fillWidth: true
model: CallManager.windowList()
}
}
RowLayout {
2022-04-16 03:13:01 +03:00
Layout.bottomMargin: 8
Layout.leftMargin: 8
Layout.rightMargin: 8
2021-02-18 23:55:29 +03:00
Label {
Layout.alignment: Qt.AlignLeft
2022-04-11 05:18:16 +03:00
color: timelineRoot.palette.windowText
2022-04-16 03:13:01 +03:00
text: qsTr("Frame rate:")
2021-02-18 23:55:29 +03:00
}
ComboBox {
id: frameRateCombo
Layout.fillWidth: true
2021-02-18 23:55:29 +03:00
model: ["25", "20", "15", "10", "5", "2", "1"]
}
}
2021-02-25 22:45:59 +03:00
GridLayout {
2022-04-16 03:13:01 +03:00
Layout.margins: 8
2021-02-25 22:45:59 +03:00
columns: 2
rowSpacing: 10
2021-02-25 22:45:59 +03:00
MatrixText {
text: qsTr("Include your camera picture-in-picture")
}
ToggleButton {
id: pipCheckBox
Layout.alignment: Qt.AlignRight
2022-04-16 03:13:01 +03:00
checked: CallManager.cameras.length > 0 && Settings.screenSharePiP
enabled: CallManager.cameras.length > 0
2021-02-25 22:45:59 +03:00
}
MatrixText {
ToolTip.text: qsTr("View your callee's camera like a regular video call")
ToolTip.visible: hovered
2022-04-16 03:13:01 +03:00
text: qsTr("Request remote camera")
2021-02-25 22:45:59 +03:00
}
ToggleButton {
id: remoteVideoCheckBox
Layout.alignment: Qt.AlignRight
ToolTip.text: qsTr("View your callee's camera like a regular video call")
ToolTip.visible: hovered
2022-04-16 03:13:01 +03:00
checked: Settings.screenShareRemoteVideo
2021-02-25 22:45:59 +03:00
}
MatrixText {
text: qsTr("Hide mouse cursor")
}
ToggleButton {
id: hideCursorCheckBox
Layout.alignment: Qt.AlignRight
checked: Settings.screenShareHideCursor
}
}
2021-02-18 23:55:29 +03:00
RowLayout {
Layout.margins: 8
Item {
Layout.fillWidth: true
}
Button {
2021-11-14 04:23:10 +03:00
icon.source: "qrc:/icons/icons/ui/screen-share.svg"
2022-04-16 03:13:01 +03:00
text: qsTr("Share")
2022-03-13 22:40:09 +03:00
2021-02-18 23:55:29 +03:00
onClicked: {
2022-03-13 22:40:09 +03:00
Settings.screenShareFrameRate = frameRateCombo.currentText;
Settings.screenSharePiP = pipCheckBox.checked;
Settings.screenShareRemoteVideo = remoteVideoCheckBox.checked;
Settings.screenShareHideCursor = hideCursorCheckBox.checked;
CallManager.sendInvite(room.roomId, Voip.SCREEN, windowCombo.currentIndex);
2022-03-13 22:40:09 +03:00
close();
2021-02-18 23:55:29 +03:00
}
}
2021-02-25 20:00:55 +03:00
Button {
text: qsTr("Preview")
2022-04-16 03:13:01 +03:00
2021-02-25 20:00:55 +03:00
onClicked: {
CallManager.previewWindow(windowCombo.currentIndex);
}
}
2021-02-18 23:55:29 +03:00
Button {
text: qsTr("Cancel")
2022-04-16 03:13:01 +03:00
2021-02-18 23:55:29 +03:00
onClicked: {
close();
}
}
}
}
}