2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
|
|
//
|
|
|
|
// 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 1.0
|
|
|
|
|
|
|
|
Popup {
|
|
|
|
modal: true
|
|
|
|
// only set the anchors on Qt 5.12 or higher
|
|
|
|
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop
|
|
|
|
Component.onCompleted: {
|
|
|
|
if (anchors)
|
|
|
|
anchors.centerIn = parent;
|
|
|
|
|
|
|
|
frameRateCombo.currentIndex = frameRateCombo.find(Settings.screenShareFrameRate);
|
|
|
|
}
|
|
|
|
palette: colors
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
2021-02-22 00:30:10 +03:00
|
|
|
Layout.topMargin: 16
|
|
|
|
Layout.bottomMargin: 16
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.rightMargin: 8
|
2021-02-18 23:55:29 +03:00
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
text: qsTr("Share desktop with %1?").arg(TimelineManager.timeline.roomName)
|
|
|
|
color: colors.windowText
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.rightMargin: 8
|
2021-02-25 01:07:01 +03:00
|
|
|
Layout.bottomMargin: 8
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
text: qsTr("Window:")
|
|
|
|
color: colors.windowText
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: windowCombo
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
model: CallManager.windowList()
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.rightMargin: 8
|
|
|
|
Layout.bottomMargin: 8
|
2021-02-18 23:55:29 +03:00
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
text: qsTr("Frame rate:")
|
|
|
|
color: colors.windowText
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: frameRateCombo
|
|
|
|
|
2021-02-25 01:07:01 +03:00
|
|
|
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 {
|
|
|
|
columns: 2
|
|
|
|
rowSpacing: 10
|
|
|
|
Layout.margins: 8
|
2021-02-20 19:26:53 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
MatrixText {
|
|
|
|
text: qsTr("Include your camera picture-in-picture")
|
|
|
|
}
|
2021-02-20 19:26:53 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
ToggleButton {
|
|
|
|
id: pipCheckBox
|
2021-02-18 23:55:29 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
enabled: CallManager.cameras.length > 0
|
|
|
|
checked: Settings.screenSharePiP
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
}
|
|
|
|
|
|
|
|
MatrixText {
|
|
|
|
text: qsTr("Request remote camera")
|
|
|
|
ToolTip.text: qsTr("View your callee's camera like a regular video call")
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
}
|
2021-02-18 23:55:29 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
ToggleButton {
|
|
|
|
id: remoteVideoCheckBox
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
checked: Settings.screenShareRemoteVideo
|
|
|
|
ToolTip.text: qsTr("View your callee's camera like a regular video call")
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
}
|
|
|
|
|
|
|
|
MatrixText {
|
|
|
|
text: qsTr("Hide mouse cursor")
|
|
|
|
}
|
|
|
|
|
|
|
|
ToggleButton {
|
|
|
|
id: hideCursorCheckBox
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
checked: Settings.screenShareHideCursor
|
|
|
|
}
|
2021-02-19 00:53:30 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
RowLayout {
|
|
|
|
Layout.margins: 8
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: qsTr("Share")
|
|
|
|
icon.source: "qrc:/icons/icons/ui/screen-share.png"
|
|
|
|
onClicked: {
|
|
|
|
if (buttonLayout.validateMic()) {
|
|
|
|
Settings.microphone = micCombo.currentText;
|
2021-02-25 01:07:01 +03:00
|
|
|
if (pipCheckBox.checked)
|
|
|
|
Settings.camera = cameraCombo.currentText;
|
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
Settings.screenShareFrameRate = frameRateCombo.currentText;
|
2021-02-20 19:26:53 +03:00
|
|
|
Settings.screenSharePiP = pipCheckBox.checked;
|
2021-02-18 23:55:29 +03:00
|
|
|
Settings.screenShareRemoteVideo = remoteVideoCheckBox.checked;
|
2021-02-19 00:53:30 +03:00
|
|
|
Settings.screenShareHideCursor = hideCursorCheckBox.checked;
|
2021-02-25 01:07:01 +03:00
|
|
|
CallManager.sendInvite(TimelineManager.timeline.roomId(), CallType.SCREEN, windowCombo.currentIndex);
|
2021-02-18 23:55:29 +03:00
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-25 20:00:55 +03:00
|
|
|
Button {
|
|
|
|
text: qsTr("Preview")
|
|
|
|
onClicked: {
|
|
|
|
CallManager.previewWindow(windowCombo.currentIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
Button {
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
onClicked: {
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: colors.window
|
|
|
|
border.color: colors.windowText
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|