Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019-2020 by Savoir-faire Linux |
| 3 | * Author: Yang Wang <yang.wang@savoirfairelinux.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | import QtQuick 2.15 |
| 20 | import QtQuick.Window 2.14 |
| 21 | import QtQuick.Controls 2.15 |
| 22 | import QtQuick.Controls.Universal 2.12 |
| 23 | import QtQuick.Layouts 1.3 |
| 24 | import QtGraphicalEffects 1.14 |
| 25 | import QtQuick.Controls.Styles 1.4 |
| 26 | import net.jami.Models 1.0 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 27 | import "../../commoncomponents" |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 28 | |
| 29 | Rectangle { |
Sébastien Blin | 2eb16d7 | 2020-08-13 23:38:43 -0400 | [diff] [blame] | 30 | id: root |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 31 | |
| 32 | AudioInputDeviceModel{ |
| 33 | id: audioInputDeviceModel |
| 34 | } |
| 35 | |
| 36 | AudioOutputDeviceModel{ |
| 37 | id: audioOutputDeviceModel |
| 38 | } |
| 39 | |
| 40 | AudioManagerListModel{ |
| 41 | id: audioManagerListModel |
| 42 | } |
| 43 | |
| 44 | VideoInputDeviceModel{ |
| 45 | id: videoInputDeviceModel |
| 46 | } |
| 47 | |
| 48 | VideoFormatResolutionModel{ |
| 49 | id: videoFormatResolutionModel |
| 50 | } |
| 51 | |
| 52 | VideoFormatFpsModel{ |
| 53 | id: videoFormatFpsModel |
| 54 | } |
| 55 | |
| 56 | function populateAVSettings(){ |
| 57 | audioInputDeviceModel.reset() |
| 58 | audioOutputDeviceModel.reset() |
| 59 | |
| 60 | inputComboBox.currentIndex = audioInputDeviceModel.getCurrentSettingIndex() |
| 61 | outputComboBox.currentIndex = audioOutputDeviceModel.getCurrentSettingIndex() |
| 62 | ringtoneDeviceComboBox.currentIndex = audioOutputDeviceModel.getCurrentRingtoneDeviceIndex() |
| 63 | |
| 64 | audioManagerRowLayout.visible = (audioManagerListModel.rowCount() > 0) |
| 65 | if(audioManagerListModel.rowCount() > 0){ |
| 66 | audioManagerComboBox.currentIndex = audioManagerListModel.getCurrentSettingIndex() |
| 67 | } |
| 68 | |
| 69 | populateVideoSettings() |
| 70 | var encodeAccel = ClientWrapper.avmodel.getHardwareAcceleration() |
| 71 | hardwareAccelControl.checked = encodeAccel |
| 72 | } |
| 73 | |
| 74 | function populateVideoSettings() { |
| 75 | videoInputDeviceModel.reset() |
| 76 | |
| 77 | deviceBox.enabled = (videoInputDeviceModel.deviceCount() > 0) |
| 78 | resolutionBox.enabled = (videoInputDeviceModel.deviceCount() > 0) |
| 79 | fpsBox.enabled = (videoInputDeviceModel.deviceCount() > 0) |
| 80 | labelVideoDevice.enabled = (videoInputDeviceModel.deviceCount() > 0) |
| 81 | labelVideoResolution.enabled = (videoInputDeviceModel.deviceCount() > 0) |
| 82 | labelVideoFps.enabled = (videoInputDeviceModel.deviceCount() > 0) |
| 83 | |
| 84 | deviceBox.currentIndex = videoInputDeviceModel.getCurrentSettingIndex() |
| 85 | slotDeviceBoxCurrentIndexChanged(deviceBox.currentIndex) |
| 86 | |
| 87 | try{ |
| 88 | startPreviewing(false) |
| 89 | } catch (err2){ console.log("Start preview fail when populate video settings, exception: "+ err2.message)} |
| 90 | |
| 91 | } |
| 92 | |
| 93 | function setFormatListForCurrentDevice(){ |
| 94 | var device = ClientWrapper.avmodel.getCurrentVideoCaptureDevice() |
| 95 | if(ClientWrapper.settingsAdaptor.get_DeviceCapabilitiesSize(device) === 0){ |
| 96 | return |
| 97 | } |
| 98 | |
| 99 | try{ |
| 100 | videoFormatResolutionModel.reset() |
| 101 | resolutionBox.currentIndex = videoFormatResolutionModel.getCurrentSettingIndex() |
| 102 | slotFormatCurrentIndexChanged(resolutionBox.currentIndex,true) |
| 103 | } catch(err){console.warn("Exception: " + err.message)} |
| 104 | } |
| 105 | |
| 106 | function startPreviewing(force = false){ |
| 107 | ClientWrapper.accountAdaptor.startPreviewing(force) |
| 108 | previewAvailable = true |
| 109 | } |
| 110 | |
| 111 | function stopPreviewing(){ |
| 112 | ClientWrapper.accountAdaptor.stopPreviewing() |
| 113 | } |
| 114 | |
| 115 | function startAudioMeter(async = true){ |
| 116 | audioInputMeter.start() |
| 117 | ClientWrapper.accountAdaptor.startAudioMeter(async) |
| 118 | } |
| 119 | |
| 120 | function stopAudioMeter(async = true){ |
| 121 | audioInputMeter.stop() |
| 122 | ClientWrapper.accountAdaptor.stopAudioMeter(async) |
| 123 | } |
| 124 | |
| 125 | // slots for av page |
| 126 | function slotAudioMeter(id, level){ |
| 127 | if (id === "audiolayer_id") { |
| 128 | audioInputMeter.setLevel(level) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | function slotSetHardwareAccel(state){ |
| 133 | ClientWrapper.accountAdaptor.avModel().setHardwareAcceleration(state) |
| 134 | startPreviewing(true) |
| 135 | } |
| 136 | |
| 137 | function slotAudioManagerIndexChanged(index){ |
| 138 | stopAudioMeter(false) |
| 139 | var selectedAudioManager = audioManagerListModel.data(audioManagerListModel.index( |
| 140 | index, 0), AudioManagerListModel.AudioManagerID) |
| 141 | ClientWrapper.avmodel.setAudioManager(selectedAudioManager) |
| 142 | startAudioMeter(false) |
| 143 | } |
| 144 | |
| 145 | function slotRingtoneDeviceIndexChanged(index){ |
| 146 | stopAudioMeter(false) |
| 147 | var selectedRingtoneDeviceName = audioOutputDeviceModel.data(audioOutputDeviceModel.index( |
| 148 | index, 0), AudioOutputDeviceModel.Device_ID) |
| 149 | ClientWrapper.avmodel.setRingtoneDevice(selectedRingtoneDeviceName) |
| 150 | startAudioMeter(false) |
| 151 | } |
| 152 | |
| 153 | function slotAudioOutputIndexChanged(index){ |
| 154 | stopAudioMeter(false) |
| 155 | var selectedOutputDeviceName = audioOutputDeviceModel.data(audioOutputDeviceModel.index( |
| 156 | index, 0), AudioOutputDeviceModel.Device_ID) |
| 157 | ClientWrapper.avmodel.setOutputDevice(selectedOutputDeviceName) |
| 158 | startAudioMeter(false) |
| 159 | } |
| 160 | |
| 161 | function slotAudioInputIndexChanged(index){ |
| 162 | stopAudioMeter(false) |
| 163 | var selectedInputDeviceName = audioInputDeviceModel.data(audioInputDeviceModel.index( |
| 164 | index, 0), AudioInputDeviceModel.Device_ID) |
| 165 | |
| 166 | ClientWrapper.avmodel.setInputDevice(selectedInputDeviceName) |
| 167 | startAudioMeter(false) |
| 168 | } |
| 169 | |
| 170 | function slotDeviceBoxCurrentIndexChanged(index){ |
| 171 | if(videoInputDeviceModel.deviceCount() <= 0){ |
| 172 | return |
| 173 | } |
| 174 | |
| 175 | try{ |
| 176 | var deviceId = videoInputDeviceModel.data(videoInputDeviceModel.index( |
| 177 | index, 0), VideoInputDeviceModel.DeviceId) |
| 178 | var deviceName = videoInputDeviceModel.data(videoInputDeviceModel.index( |
| 179 | index, 0), VideoInputDeviceModel.DeviceName) |
| 180 | if(deviceId.length === 0){ |
| 181 | console.warn("Couldn't find device: " + deviceName) |
| 182 | return |
| 183 | } |
| 184 | |
| 185 | ClientWrapper.avmodel.setCurrentVideoCaptureDevice(deviceId) |
| 186 | ClientWrapper.avmodel.setDefaultDevice(deviceId) |
| 187 | setFormatListForCurrentDevice() |
| 188 | startPreviewing(true) |
| 189 | } catch(err){console.warn(err.message)} |
| 190 | } |
| 191 | |
| 192 | function slotFormatCurrentIndexChanged(index, isResolutionIndex){ |
| 193 | var resolution |
| 194 | var rate |
| 195 | if(isResolutionIndex){ |
| 196 | resolution = videoFormatResolutionModel.data(videoFormatResolutionModel.index( |
| 197 | index, 0), VideoFormatResolutionModel.Resolution) |
| 198 | videoFormatFpsModel.currentResolution = resolution |
| 199 | fpsBox.currentIndex = videoFormatFpsModel.getCurrentSettingIndex() |
| 200 | rate = videoFormatFpsModel.data(videoFormatFpsModel.index( |
| 201 | fpsBox.currentIndex, 0), VideoFormatFpsModel.FPS) |
| 202 | } else { |
| 203 | resolution = videoFormatResolutionModel.data(videoFormatResolutionModel.index( |
| 204 | resolutionBox.currentIndex, 0), VideoFormatResolutionModel.Resolution) |
| 205 | videoFormatFpsModel.currentResolution = resolution |
| 206 | rate = videoFormatFpsModel.data(videoFormatFpsModel.index( |
| 207 | index, 0), VideoFormatFpsModel.FPS) |
| 208 | } |
| 209 | |
| 210 | try{ |
| 211 | ClientWrapper.settingsAdaptor.set_Video_Settings_Rate_And_Resolution(ClientWrapper.avmodel.getCurrentVideoCaptureDevice(),rate,resolution) |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 212 | updatePreviewRatio(resolution) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 213 | } catch(error){console.warn(error.message)} |
| 214 | } |
| 215 | |
| 216 | function slotVideoDeviceListChanged(){ |
| 217 | populateVideoSettings() |
| 218 | } |
| 219 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 220 | function updatePreviewRatio(resolution){ |
| 221 | var res = resolution.split("x") |
| 222 | var ratio = res[1] / res[0] |
| 223 | if (ratio) { |
| 224 | aspectRatio = ratio |
| 225 | } else { |
| 226 | console.error("Could not scale recording video preview") |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | property int preferredColumnWidth: avSettingsScrollView.width / 2 - 50 |
| 231 | property int preferredSettingsWidth: avSettingsScrollView.width - 100 |
| 232 | |
| 233 | property real aspectRatio: 0.75 |
| 234 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 235 | property bool previewAvailable: false |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 236 | signal backArrowClicked |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 237 | |
| 238 | Connections{ |
| 239 | target: ClientWrapper.avmodel |
Sébastien Blin | 2eb16d7 | 2020-08-13 23:38:43 -0400 | [diff] [blame] | 240 | enabled: root.visible |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 241 | |
| 242 | function onAudioMeter(id, level){ |
| 243 | slotAudioMeter(id,level) |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | Connections{ |
| 248 | target: ClientWrapper.renderManager |
Sébastien Blin | 2eb16d7 | 2020-08-13 23:38:43 -0400 | [diff] [blame] | 249 | enabled: root.visible |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 250 | |
| 251 | function onVideoDeviceListChanged(){ |
| 252 | slotVideoDeviceListChanged() |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | Layout.fillHeight: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 257 | Layout.maximumWidth: JamiTheme.maximumWidthSettingsView |
| 258 | anchors.centerIn: parent |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 259 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 260 | ColumnLayout { |
Sébastien Blin | 2eb16d7 | 2020-08-13 23:38:43 -0400 | [diff] [blame] | 261 | anchors.fill: root |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 262 | |
| 263 | RowLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 264 | id: avSettingsTitle |
| 265 | Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter |
| 266 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 267 | Layout.fillWidth: true |
| 268 | Layout.maximumHeight: 64 |
| 269 | Layout.minimumHeight: 64 |
| 270 | Layout.preferredHeight: 64 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 271 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 272 | HoverableButton { |
| 273 | id: backToSettingsMenuButton |
| 274 | |
| 275 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft |
| 276 | Layout.preferredWidth: JamiTheme.preferredFieldHeight |
| 277 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 278 | Layout.rightMargin: JamiTheme.preferredMarginSize |
| 279 | |
| 280 | radius: 30 |
| 281 | source: "qrc:/images/icons/ic_arrow_back_24px.svg" |
| 282 | backgroundColor: "white" |
| 283 | onExitColor: "white" |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame^] | 284 | toolTipText: qsTr("Toggle to display side panel") |
| 285 | hoverEnabled: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 286 | |
| 287 | visible: mainViewWindow.sidePanelHidden |
| 288 | |
| 289 | onClicked: { |
| 290 | backArrowClicked() |
| 291 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 292 | } |
| 293 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 294 | Label { |
| 295 | Layout.fillWidth: true |
| 296 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 297 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 298 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 299 | |
| 300 | text: qsTr("Audio / Video") |
| 301 | font.pointSize: JamiTheme.titleFontSize |
| 302 | font.kerning: true |
| 303 | |
| 304 | horizontalAlignment: Text.AlignLeft |
| 305 | verticalAlignment: Text.AlignVCenter |
| 306 | } |
| 307 | |
| 308 | } |
| 309 | |
| 310 | |
| 311 | ScrollView { |
| 312 | id: avSettingsScrollView |
| 313 | property ScrollBar vScrollBar: ScrollBar.vertical |
| 314 | |
| 315 | Layout.fillHeight: true |
| 316 | Layout.fillWidth: true |
| 317 | |
| 318 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter |
| 319 | |
Sébastien Blin | 2eb16d7 | 2020-08-13 23:38:43 -0400 | [diff] [blame] | 320 | width: root.width |
| 321 | height: root.height - avSettingsTitle.height |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 322 | |
| 323 | ScrollBar.horizontal.policy: ScrollBar.AlwaysOff |
| 324 | ScrollBar.vertical.policy: ScrollBar.AsNeeded |
| 325 | |
| 326 | clip: true |
| 327 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 328 | ColumnLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 329 | Layout.fillHeight: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 330 | Layout.fillWidth: true |
| 331 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 332 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 333 | spacing: 24 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 334 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 335 | // Audio |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 336 | ColumnLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 337 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 338 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 339 | Layout.leftMargin: JamiTheme.preferredMarginSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 340 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 341 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 342 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 343 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 344 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 345 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 346 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 347 | eText: qsTr("Audio") |
| 348 | fontSize: JamiTheme.headerFontSize |
| 349 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | ColumnLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 353 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 354 | Layout.leftMargin: JamiTheme.preferredMarginSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 355 | |
| 356 | RowLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 357 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 358 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 359 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 360 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 361 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 362 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 363 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 364 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 365 | |
| 366 | eText: qsTr("Microphone") |
| 367 | fontSize: JamiTheme.settingsFontSize |
| 368 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 369 | } |
| 370 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 371 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 372 | SettingParaCombobox { |
| 373 | id: inputComboBox |
| 374 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 375 | Layout.maximumWidth: preferredColumnWidth |
| 376 | Layout.preferredWidth: preferredColumnWidth |
| 377 | Layout.minimumWidth: preferredColumnWidth |
| 378 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 379 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 380 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 381 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 382 | font.pointSize: JamiTheme.buttonFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 383 | font.kerning: true |
| 384 | |
| 385 | model: audioInputDeviceModel |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 386 | textRole: "ID_UTF8" |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame^] | 387 | tooltipText: qsTr("Audio input device selector") |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 388 | onActivated: { |
| 389 | slotAudioInputIndexChanged(index) |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | // the audio level meter |
| 395 | LevelMeter { |
| 396 | id: audioInputMeter |
| 397 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 398 | Layout.minimumWidth: preferredSettingsWidth |
| 399 | Layout.preferredWidth: preferredSettingsWidth |
| 400 | Layout.maximumWidth: preferredSettingsWidth |
| 401 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 402 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 403 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 404 | |
| 405 | indeterminate: false |
| 406 | from: 0 |
| 407 | to: 100 |
| 408 | } |
| 409 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 410 | RowLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 411 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 412 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 413 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 414 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 415 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 416 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 417 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 418 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 419 | |
| 420 | eText: qsTr("Output Device") |
| 421 | fontSize: JamiTheme.settingsFontSize |
| 422 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 423 | } |
| 424 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 425 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 426 | SettingParaCombobox { |
| 427 | id: outputComboBox |
| 428 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 429 | Layout.maximumWidth: preferredColumnWidth |
| 430 | Layout.preferredWidth: preferredColumnWidth |
| 431 | Layout.minimumWidth: preferredColumnWidth |
| 432 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 433 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 434 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 435 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 436 | font.pointSize: JamiTheme.settingsFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 437 | font.kerning: true |
| 438 | |
| 439 | model: audioOutputDeviceModel |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 440 | textRole: "ID_UTF8" |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame^] | 441 | tooltipText: qsTr("Choose the audio output device") |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 442 | onActivated: { |
| 443 | slotAudioOutputIndexChanged(index) |
| 444 | } |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | RowLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 449 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 450 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 451 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 452 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 453 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 454 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 455 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 456 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 457 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 458 | |
| 459 | eText: qsTr("Ringtone Device") |
| 460 | font.pointSize: JamiTheme.settingsFontSize |
| 461 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 462 | } |
| 463 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 464 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 465 | SettingParaCombobox { |
| 466 | id: ringtoneDeviceComboBox |
| 467 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 468 | Layout.maximumWidth: preferredColumnWidth |
| 469 | Layout.preferredWidth: preferredColumnWidth |
| 470 | Layout.minimumWidth: preferredColumnWidth |
| 471 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 472 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 473 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 474 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 475 | font.pointSize: JamiTheme.buttonFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 476 | font.kerning: true |
| 477 | |
| 478 | model: audioOutputDeviceModel |
| 479 | |
| 480 | textRole: "ID_UTF8" |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame^] | 481 | tooltipText: qsTr("Choose the ringtone output device") |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 482 | onActivated: { |
| 483 | slotRingtoneDeviceIndexChanged(index) |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | RowLayout { |
| 489 | id: audioManagerRowLayout |
| 490 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 491 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 492 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 493 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 494 | ElidedTextLabel { |
| 495 | Layout.fillWidth: true |
| 496 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 497 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 498 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 499 | |
| 500 | text: qsTr("Audio Manager") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 501 | fontSize: JamiTheme.settingsFontSize |
| 502 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 503 | } |
| 504 | |
| 505 | SettingParaCombobox { |
| 506 | id: audioManagerComboBox |
| 507 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 508 | Layout.maximumWidth: preferredColumnWidth |
| 509 | Layout.preferredWidth: preferredColumnWidth |
| 510 | Layout.minimumWidth: preferredColumnWidth |
| 511 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 512 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 513 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 514 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 515 | font.pointSize: JamiTheme.buttonFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 516 | font.kerning: true |
| 517 | |
| 518 | model: audioManagerListModel |
| 519 | |
| 520 | textRole: "ID_UTF8" |
| 521 | |
| 522 | onActivated: { |
| 523 | slotAudioManagerIndexChanged(index) |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 530 | ColumnLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 531 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 532 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 533 | Layout.leftMargin: JamiTheme.preferredMarginSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 534 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 535 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 536 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 537 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 538 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 539 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 540 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 541 | eText: qsTr("Video") |
| 542 | fontSize: JamiTheme.headerFontSize |
| 543 | maxWidth: preferredSettingsWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 544 | } |
| 545 | |
| 546 | ColumnLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 547 | Layout.leftMargin: 16 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 548 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 549 | RowLayout { |
| 550 | Layout.fillWidth: true |
| 551 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 552 | |
| 553 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 554 | id: labelVideoDevice |
| 555 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 556 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 557 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 558 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 559 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 560 | |
| 561 | eText: qsTr("Device") |
| 562 | fontSize: JamiTheme.settingsFontSize |
| 563 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 564 | } |
| 565 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 566 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 567 | SettingParaCombobox { |
| 568 | id: deviceBox |
| 569 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 570 | Layout.maximumWidth: preferredColumnWidth |
| 571 | Layout.preferredWidth: preferredColumnWidth |
| 572 | Layout.minimumWidth: preferredColumnWidth |
| 573 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 574 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 575 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 576 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 577 | font.pointSize: JamiTheme.buttonFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 578 | font.kerning: true |
| 579 | |
| 580 | model: videoInputDeviceModel |
| 581 | |
| 582 | textRole: "DeviceName_UTF8" |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame^] | 583 | tooltipText: qsTr("Video device selector") |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 584 | onActivated: { |
| 585 | slotDeviceBoxCurrentIndexChanged(index) |
| 586 | } |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | RowLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 591 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 592 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 593 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 594 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 595 | id: labelVideoResolution |
| 596 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 597 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 598 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 599 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 600 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 601 | |
| 602 | eText: qsTr("Resolution") |
| 603 | fontSize: JamiTheme.settingsFontSize |
| 604 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 605 | } |
| 606 | |
| 607 | SettingParaCombobox { |
| 608 | id: resolutionBox |
| 609 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 610 | Layout.maximumWidth: preferredColumnWidth |
| 611 | Layout.preferredWidth: preferredColumnWidth |
| 612 | Layout.minimumWidth: preferredColumnWidth |
| 613 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 614 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 615 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 616 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 617 | font.pointSize: JamiTheme.buttonFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 618 | font.kerning: true |
| 619 | |
| 620 | model: videoFormatResolutionModel |
| 621 | textRole: "Resolution_UTF8" |
| 622 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame^] | 623 | tooltipText: qsTr("Video device resolution selector") |
| 624 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 625 | onActivated: { |
| 626 | slotFormatCurrentIndexChanged(index,true) |
| 627 | } |
| 628 | } |
| 629 | } |
| 630 | |
| 631 | RowLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 632 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 633 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 634 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 635 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 636 | id: labelVideoFps |
| 637 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 638 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 639 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 640 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 641 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 642 | |
| 643 | eText: qsTr("Fps") |
| 644 | fontSize: JamiTheme.settingsFontSize |
| 645 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 646 | } |
| 647 | |
| 648 | SettingParaCombobox { |
| 649 | id: fpsBox |
| 650 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 651 | Layout.maximumWidth: preferredColumnWidth |
| 652 | Layout.preferredWidth: preferredColumnWidth |
| 653 | Layout.minimumWidth: preferredColumnWidth |
| 654 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 655 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 656 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 657 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 658 | font.pointSize: JamiTheme.buttonFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 659 | font.kerning: true |
| 660 | |
| 661 | model: videoFormatFpsModel |
| 662 | textRole: "FPS_ToDisplay_UTF8" |
| 663 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame^] | 664 | tooltipText: qsTr("Video device fps selector") |
| 665 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 666 | onActivated: { |
| 667 | slotFormatCurrentIndexChanged(index,false) |
| 668 | } |
| 669 | } |
| 670 | } |
| 671 | } |
| 672 | } |
| 673 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 674 | Rectangle { |
| 675 | id: rectBox |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 676 | Layout.alignment: Qt.AlignHCenter |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 677 | Layout.maximumHeight: width * aspectRatio |
| 678 | Layout.minimumHeight: width * aspectRatio |
| 679 | Layout.preferredHeight: width * aspectRatio |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 680 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 681 | Layout.minimumWidth: 200 |
| 682 | Layout.maximumWidth: 400 |
| 683 | Layout.preferredWidth: preferredSettingsWidth |
| 684 | color: "white" |
| 685 | radius: 5 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 686 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 687 | PreviewRenderer { |
| 688 | id: previewWidget |
| 689 | anchors.fill: rectBox |
| 690 | anchors.centerIn: rectBox |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 691 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 692 | layer.enabled: true |
| 693 | layer.effect: OpacityMask { |
| 694 | maskSource: rectBox |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 695 | } |
| 696 | } |
| 697 | } |
| 698 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 699 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 700 | Label { |
| 701 | visible: !previewAvailable |
| 702 | |
| 703 | Layout.fillWidth: true |
| 704 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 705 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 706 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 707 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 708 | |
| 709 | text: qsTr("Preview unavailable") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 710 | font.pointSize: JamiTheme.settingsFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 711 | font.kerning: true |
| 712 | |
| 713 | horizontalAlignment: Text.AlignHCenter |
| 714 | verticalAlignment: Text.AlignVCenter |
| 715 | } |
| 716 | |
| 717 | // Toggle switch to enable hardware acceleration |
| 718 | ToggleSwitch { |
| 719 | id: hardwareAccelControl |
| 720 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 721 | Layout.fillWidth: true |
| 722 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 723 | |
| 724 | labelText: hwAccelText.elidedText |
| 725 | fontPointSize: JamiTheme.settingsFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 726 | |
| 727 | onSwitchToggled: { |
| 728 | slotSetHardwareAccel(checked) |
| 729 | } |
| 730 | } |
| 731 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 732 | TextMetrics { |
| 733 | id: hwAccelText |
| 734 | elide: Text.ElideRight |
| 735 | elideWidth: preferredSettingsWidth - 50 |
| 736 | text: qsTr("Enable hardware acceleration") |
| 737 | } |
| 738 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 739 | Item { |
Sébastien Blin | 2eb16d7 | 2020-08-13 23:38:43 -0400 | [diff] [blame] | 740 | Layout.preferredWidth: root.width - 32 |
| 741 | Layout.minimumWidth: root.width - 32 |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 742 | Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 743 | Layout.fillHeight: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 744 | } |
| 745 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 746 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 747 | } |
| 748 | } |