| 1 |
// SPDX-FileCopyrightText: Nheko Contributors |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: GPL-3.0-or-later |
| 4 |
|
| 5 |
import QtQuick 2.9 |
| 6 |
import QtQuick.Controls 2.3 |
| 7 |
import QtQuick.Layouts 1.2 |
| 8 |
import im.nheko 1.0 |
| 9 |
|
| 10 |
Popup { |
| 11 |
modal: true |
| 12 |
// only set the anchors on Qt 5.12 or higher |
| 13 |
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop |
| 14 |
Component.onCompleted: { |
| 15 |
if (anchors) |
| 16 |
anchors.centerIn = parent; |
| 17 |
|
| 18 |
} |
| 19 |
|
| 20 |
ColumnLayout { |
| 21 |
spacing: 16 |
| 22 |
|
| 23 |
ColumnLayout { |
| 24 |
spacing: 8 |
| 25 |
Layout.topMargin: 8 |
| 26 |
Layout.leftMargin: 8 |
| 27 |
Layout.rightMargin: 8 |
| 28 |
|
| 29 |
RowLayout { |
| 30 |
Image { |
| 31 |
Layout.preferredWidth: 22 |
| 32 |
Layout.preferredHeight: 22 |
| 33 |
source: "image://colorimage/:/icons/icons/ui/microphone-unmute.svg?" + palette.windowText |
| 34 |
} |
| 35 |
|
| 36 |
ComboBox { |
| 37 |
id: micCombo |
| 38 |
|
| 39 |
Layout.fillWidth: true |
| 40 |
model: CallManager.mics |
| 41 |
} |
| 42 |
|
| 43 |
} |
| 44 |
|
| 45 |
RowLayout { |
| 46 |
visible: CallManager.callType == Voip.VIDEO && CallManager.cameras.length > 0 |
| 47 |
|
| 48 |
Image { |
| 49 |
Layout.preferredWidth: 22 |
| 50 |
Layout.preferredHeight: 22 |
| 51 |
source: "image://colorimage/:/icons/icons/ui/video-call.svg?" + palette.windowText |
| 52 |
} |
| 53 |
|
| 54 |
ComboBox { |
| 55 |
id: cameraCombo |
| 56 |
|
| 57 |
Layout.fillWidth: true |
| 58 |
model: CallManager.cameras |
| 59 |
} |
| 60 |
|
| 61 |
} |
| 62 |
|
| 63 |
} |
| 64 |
|
| 65 |
DialogButtonBox { |
| 66 |
Layout.leftMargin: 128 |
| 67 |
standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel |
| 68 |
onAccepted: { |
| 69 |
Settings.microphone = micCombo.currentText; |
| 70 |
if (cameraCombo.visible) |
| 71 |
Settings.camera = cameraCombo.currentText; |
| 72 |
|
| 73 |
close(); |
| 74 |
} |
| 75 |
onRejected: { |
| 76 |
close(); |
| 77 |
} |
| 78 |
} |
| 79 |
|
| 80 |
} |
| 81 |
|
| 82 |
background: Rectangle { |
| 83 |
color: palette.window |
| 84 |
border.color: palette.windowText |
| 85 |
} |
| 86 |
|
| 87 |
} |