Newer
Older
// SPDX-FileCopyrightText: 2021 Nheko Contributors
import QtQuick.Layouts 1.2
// 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;
}
Component {
id: screenShareDialog
ScreenShare {
}
}
text: qsTr("Place a call to %1?").arg(room.roomName)
function validateMic() {
if (CallManager.mics.length == 0) {
var dialog = deviceError.createObject(timelineRoot, {
"errorString": qsTr("No microphone found."),
Layout.leftMargin: 8
Layout.rightMargin: 8
width: Nheko.avatarSize
height: Nheko.avatarSize
url: room.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
displayName: room.roomName
onClicked: TimelineManager.openImageOverlay(room.avatarUrl(userid), room.data.eventId)
icon.source: "qrc:/icons/icons/ui/place-call.png"
onClicked: {
CallManager.sendInvite(room.roomId, CallType.VOICE);
close();
}
}
}
Button {
visible: CallManager.cameras.length > 0
icon.source: "qrc:/icons/icons/ui/video-call.png"
onClicked: {
Settings.microphone = micCombo.currentText;
Settings.camera = cameraCombo.currentText;
CallManager.sendInvite(room.roomId, CallType.VIDEO);
Button {
visible: CallManager.screenShareSupported
text: qsTr("Screen")
icon.source: "qrc:/icons/icons/ui/screen-share.png"
onClicked: {
var dialog = screenShareDialog.createObject(timelineRoot);
dialog.open();
close();
}
}
Button {
text: qsTr("Cancel")
onClicked: {
close();
}
}
RowLayout {
Layout.leftMargin: 8
Layout.rightMargin: 8
Image {
Layout.preferredWidth: 22
Layout.preferredHeight: 22
source: "image://colorimage/:/icons/icons/ui/microphone-unmute.png?" + Nheko.colors.windowText
Layout.fillWidth: true
model: CallManager.mics
}
RowLayout {
visible: CallManager.cameras.length > 0
Layout.leftMargin: 8
Layout.rightMargin: 8
Image {
Layout.preferredWidth: 22
Layout.preferredHeight: 22
source: "image://colorimage/:/icons/icons/ui/video-call.png?" + Nheko.colors.windowText
Layout.fillWidth: true
model: CallManager.cameras
}
color: Nheko.colors.window
border.color: Nheko.colors.windowText