matrixion/qml/voip/CallDevices.qml

77 lines
2.3 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
import QtQuick 2.9
2020-12-20 17:37:22 +03:00
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import im.nheko
2020-12-20 17:37:22 +03:00
2020-12-30 23:03:07 +03:00
Popup {
modal: true
2022-04-11 05:18:16 +03:00
palette: timelineRoot.palette
2022-04-16 03:13:01 +03:00
background: Rectangle {
border.color: timelineRoot.palette.windowText
color: timelineRoot.palette.window
}
// 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;
}
2020-12-20 17:37:22 +03:00
ColumnLayout {
spacing: 16
ColumnLayout {
2020-12-30 23:03:07 +03:00
Layout.leftMargin: 8
Layout.rightMargin: 8
2022-04-16 03:13:01 +03:00
Layout.topMargin: 8
spacing: 8
2020-12-20 17:37:22 +03:00
2020-12-30 23:03:07 +03:00
RowLayout {
2020-12-20 17:37:22 +03:00
Image {
Layout.preferredHeight: 22
2022-04-16 03:13:01 +03:00
Layout.preferredWidth: 22
2022-04-11 05:18:16 +03:00
source: "image://colorimage/:/icons/icons/ui/microphone-unmute.svg?" + timelineRoot.palette.windowText
2020-12-20 17:37:22 +03:00
}
ComboBox {
id: micCombo
Layout.fillWidth: true
model: CallManager.mics
}
}
RowLayout {
visible: CallManager.callType == Voip.VIDEO && CallManager.cameras.length > 0
2020-12-20 17:37:22 +03:00
Image {
Layout.preferredHeight: 22
2022-04-16 03:13:01 +03:00
Layout.preferredWidth: 22
2022-04-11 05:18:16 +03:00
source: "image://colorimage/:/icons/icons/ui/video-call.svg?" + timelineRoot.palette.windowText
2020-12-20 17:37:22 +03:00
}
ComboBox {
id: cameraCombo
Layout.fillWidth: true
model: CallManager.cameras
}
}
}
2020-12-30 23:03:07 +03:00
DialogButtonBox {
Layout.leftMargin: 128
standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel
2022-04-16 03:13:01 +03:00
2021-01-12 01:51:39 +03:00
onAccepted: {
Settings.microphone = micCombo.currentText;
if (cameraCombo.visible)
Settings.camera = cameraCombo.currentText;
2020-12-30 23:03:07 +03:00
close();
2020-12-20 17:37:22 +03:00
}
2020-12-30 23:03:07 +03:00
onRejected: {
close();
2020-12-20 17:37:22 +03:00
}
}
2021-01-12 01:51:39 +03:00
}
2020-12-20 17:37:22 +03:00
}