From 6fa0861fbd543aec14fe345134cb8505e43113d0 Mon Sep 17 00:00:00 2001 From: ababi <albert.babi@savoirfairelinux.com> Date: Mon, 10 Aug 2020 19:13:28 +0200 Subject: [PATCH] settingsview: redesign UI Gitlab: #3 Change-Id: I382bc51b78cb5aff45e7dad008c97368494780d8 --- qml.qrc | 1 + src/commoncomponents/ElidedTextLabel.qml | 44 + src/commoncomponents/PhotoboothView.qml | 36 +- src/constant/JamiTheme.qml | 8 + src/mainview/MainView.qml | 2 +- src/mainview/components/RecordBox.qml | 2 +- .../components/AdvancedSIPSettingsView.qml | 2576 ++++++----------- .../components/AdvancedSettingsView.qml | 949 +++--- src/settingsview/components/AvSettingPage.qml | 629 ++-- .../components/BannedItemDelegate.qml | 107 +- .../CurrentAccountSettingsScrollPage.qml | 1263 ++++---- .../CurrentSIPAccountSettingScrollPage.qml | 690 ++--- .../components/DeviceItemDelegate.qml | 185 +- .../components/GeneralSettingsPage.qml | 677 ++--- src/settingsview/components/IconButton.qml | 8 +- .../components/SettingParaCombobox.qml | 3 +- src/settingsview/components/ToggleSwitch.qml | 37 +- 17 files changed, 2898 insertions(+), 4319 deletions(-) create mode 100644 src/commoncomponents/ElidedTextLabel.qml diff --git a/qml.qrc b/qml.qrc index 19294fa8d..50e529759 100644 --- a/qml.qrc +++ b/qml.qrc @@ -95,5 +95,6 @@ <file>src/wizardview/components/HoverableGradientButton.qml</file> <file>src/commoncomponents/AccountMigrationDialog.qml</file> <file>src/mainview/components/RecordBox.qml</file> + <file>src/commoncomponents/ElidedTextLabel.qml</file> </qresource> </RCC> diff --git a/src/commoncomponents/ElidedTextLabel.qml b/src/commoncomponents/ElidedTextLabel.qml new file mode 100644 index 000000000..b94435db6 --- /dev/null +++ b/src/commoncomponents/ElidedTextLabel.qml @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2020 by Savoir-faire Linux + * Author: Albert Babà <albert.babig@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +import QtQuick 2.14 +import QtQuick.Controls 1.4 +import net.jami.Models 1.0 + + +Label { + property string eText : "" + property int maxWidth: 100 + property int fontSize: JamiTheme.textFontSize + + font.pointSize: fontSize + font.kerning: true + + text: elided.elidedText + + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + color: "black" + + TextMetrics { + id: elided + elide: Text.ElideRight + elideWidth: maxWidth + text: eText + } +} diff --git a/src/commoncomponents/PhotoboothView.qml b/src/commoncomponents/PhotoboothView.qml index 4b006fa95..3a76bc8be 100644 --- a/src/commoncomponents/PhotoboothView.qml +++ b/src/commoncomponents/PhotoboothView.qml @@ -13,7 +13,7 @@ ColumnLayout{ property string imgBase64: "" property string fileName: "" - property int boothWidht: 224 + property int boothWidth: 224 signal imageAcquired signal imageCleared @@ -65,7 +65,7 @@ ColumnLayout{ return } imgBase64 = ClientWrapper.utilsAdaptor.getCroppedImageBase64FromFile( - ClientWrapper.utilsAdaptor.getAbsPath(fileName),boothWidht) + ClientWrapper.utilsAdaptor.getAbsPath(fileName),boothWidth) imageAcquired() stopBooth() } @@ -73,9 +73,9 @@ ColumnLayout{ spacing: 0 - Layout.maximumWidth: boothWidht - Layout.preferredWidth: boothWidht - Layout.minimumWidth: boothWidht + Layout.maximumWidth: boothWidth + Layout.preferredWidth: boothWidth + Layout.minimumWidth: boothWidth Layout.maximumHeight: 0 @@ -86,13 +86,13 @@ ColumnLayout{ visible: !takePhotoState - Layout.maximumWidth: boothWidht - Layout.preferredWidth: boothWidht - Layout.minimumWidth: boothWidht + Layout.maximumWidth: boothWidth + Layout.preferredWidth: boothWidth + Layout.minimumWidth: boothWidth - Layout.maximumHeight: boothWidht - Layout.preferredHeight: boothWidht - Layout.minimumHeight: boothWidht + Layout.maximumHeight: boothWidth + Layout.preferredHeight: boothWidth + Layout.minimumHeight: boothWidth Layout.alignment: Qt.AlignHCenter @@ -139,13 +139,13 @@ ColumnLayout{ focus: visible Layout.alignment: Qt.AlignHCenter - Layout.maximumWidth: boothWidht - Layout.preferredWidth: boothWidht - Layout.minimumWidth: boothWidht + Layout.maximumWidth: boothWidth + Layout.preferredWidth: boothWidth + Layout.minimumWidth: boothWidth - Layout.maximumHeight: boothWidht - Layout.preferredHeight: boothWidht - Layout.minimumHeight: boothWidht + Layout.maximumHeight: boothWidth + Layout.preferredHeight: boothWidth + Layout.minimumHeight: boothWidth layer.enabled: true layer.effect: OpacityMask { @@ -233,7 +233,7 @@ ColumnLayout{ flashAnimation.restart() // run concurrent function call to take photo - imgBase64 = previewWidget.takeCroppedPhotoToBase64(boothWidht) + imgBase64 = previewWidget.takeCroppedPhotoToBase64(boothWidth) hasAvatar = true imageAcquired() stopBooth() diff --git a/src/constant/JamiTheme.qml b/src/constant/JamiTheme.qml index 0f8bff2c7..5fa324d58 100644 --- a/src/constant/JamiTheme.qml +++ b/src/constant/JamiTheme.qml @@ -75,9 +75,17 @@ Item { property int splitViewHandlePreferredWidth: 4 property int textFontSize: 9 + property int settingsFontSize: 10 + property int buttonFontSize: 9 + property int headerFontSize: 13 property int titleFontSize: 16 property int menuFontSize: 12 + property int maximumWidthSettingsView: 800 + property int preferredButtonWidth: 200 + property int preferredFieldHeight: 32 + property int preferredMarginSize: 16 + /* * Place holder text. diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index aa9dcec2e..1e6b4227c 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -249,7 +249,7 @@ Window { handle: Rectangle { implicitWidth: JamiTheme.splitViewHandlePreferredWidth implicitHeight: splitView.height - color:"transparent" + color:"white" Rectangle { implicitWidth: 1 implicitHeight: splitView.height diff --git a/src/mainview/components/RecordBox.qml b/src/mainview/components/RecordBox.qml index 274e28de2..109132711 100644 --- a/src/mainview/components/RecordBox.qml +++ b/src/mainview/components/RecordBox.qml @@ -82,7 +82,7 @@ Rectangle { var device = ClientWrapper.avmodel.getDefaultDevice() var settings = ClientWrapper.settingsAdaptor.get_Video_Settings_Size(device) var res = settings.split("x") - var aspectRatio = res[1]/res[0] + var aspectRatio = res[1] / res[0] if (aspectRatio) { height = preferredWidth*aspectRatio } else { diff --git a/src/settingsview/components/AdvancedSIPSettingsView.qml b/src/settingsview/components/AdvancedSIPSettingsView.qml index 5ebcf84a8..b552ca3bd 100644 --- a/src/settingsview/components/AdvancedSIPSettingsView.qml +++ b/src/settingsview/components/AdvancedSIPSettingsView.qml @@ -332,93 +332,100 @@ ColumnLayout { } } - spacing: 6 - Layout.preferredWidth: 532 - Layout.maximumWidth: 532 + id: advancedSIPSettingsViewLayout + Layout.fillWidth: true + spacing: 24 - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 24 - Layout.preferredHeight: 24 - Layout.maximumHeight: 24 - } + property int preferredColumnWidth : sipAccountViewRect.width / 2 - 50 + property int preferredSettingsWidth: sipAccountViewRect.width - 80 // call setting section ColumnLayout { - spacing: 6 + + spacing: 8 Layout.fillWidth: true - Label { + ElidedTextLabel { Layout.fillWidth: true - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Call Settings") - - font.pointSize: 13 - font.kerning: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Call Settings") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } ColumnLayout { - spacing: 6 Layout.fillWidth: true - Layout.leftMargin: 20 + Layout.leftMargin: JamiTheme.preferredMarginSize ToggleSwitch { id: checkBoxAutoAnswerSIP - labelText: qsTr("Auto Answer Call") - fontPointSize: 10 - Layout.leftMargin: 20 + labelText: autoAnswerCallsText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setAutoAnswerCalls(checked) } } - RowLayout { - Layout.fillWidth: true - Layout.leftMargin: 20 - Layout.maximumHeight: 30 + TextMetrics { + id: autoAnswerCallsText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Auto Answer Calls") + } - ToggleSwitch { - id: checkBoxCustomRingtoneSIP - labelText: qsTr("Enable Custom Ringtone") - fontPointSize: 10 + ToggleSwitch { + id: checkBoxCustomRingtoneSIP - Layout.maximumWidth: 164 - Layout.preferredWidth: 164 - Layout.minimumWidth: 164 + labelText: enableCustomRingtoneSIPElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setEnableRingtone(checked) - btnRingtoneSIP.enabled = checked - } + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setEnableRingtone(checked) + btnRingtoneSIP.enabled = checked } + } - Item { - Layout.fillHeight: true + TextMetrics { + id: enableCustomRingtoneSIPElidedText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Enable Custom Ringtone") + } + + + RowLayout { + Layout.fillWidth: true + + ElidedTextLabel { Layout.fillWidth: true + + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + eText: qsTr("Select Custom Ringtone") + maxWidth: preferredColumnWidth + fontSize: JamiTheme.settingsFontSize } HoverableRadiusButton { id: btnRingtoneSIP - radius: height / 2 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - Layout.maximumWidth: 164 - Layout.preferredWidth: 164 - Layout.minimumWidth: 164 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + radius: height / 2 icon.source: "qrc:/images/icons/round-folder-24px.svg" icon.width: 16 @@ -432,63 +439,37 @@ ColumnLayout { } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - // voice mail section ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true - Label { + ElidedTextLabel { Layout.fillWidth: true - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Voicemail") - - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 13 - Layout.preferredHeight: 13 - Layout.maximumHeight: 13 + eText: qsTr("Voicemail") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } RowLayout { Layout.fillWidth: true - Layout.leftMargin: 20 - Layout.maximumHeight: 30 - - Label { - Layout.maximumWidth: 162 - Layout.preferredWidth: 162 - Layout.minimumWidth: 162 - - Layout.minimumHeight: 28 - Layout.preferredHeight: 28 - Layout.maximumHeight: 28 + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.leftMargin: JamiTheme.preferredMarginSize - text: qsTr("Voicemail Dial Code") - font.pointSize: 10 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Voicemail Dial Code") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } Item { @@ -499,12 +480,12 @@ ColumnLayout { InfoLineEdit { id: lineEditVoiceMailDialCode - fieldLayoutWidth: 250 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter onEditingFinished: { @@ -514,62 +495,32 @@ ColumnLayout { } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - // security section ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true - Label { + ElidedTextLabel { Layout.fillWidth: true - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Security") - - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 13 - Layout.preferredHeight: 13 - Layout.minimumHeight: 13 + eText: qsTr("Security") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } - GridLayout { - Layout.leftMargin: 20 + ColumnLayout { Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - rowSpacing: 6 - columnSpacing: 6 - - rows: 14 - columns: 3 - - // First row - ToggleSwitch{ + ToggleSwitch { id: encryptMediaStreamsToggle - labelText: qsTr("Encrypt Media Streams(SRTP)") - fontPointSize: 10 - - Layout.row: 0 - Layout.column: 0 + labelText: encryptMediaStreamsText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setUseSRTP(checked) @@ -578,78 +529,54 @@ ColumnLayout { } } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 0 - Layout.column: 1 + TextMetrics { + id: encryptMediaStreamsText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Encrypt Media Streams (SRTP)") } - // second row - ToggleSwitch{ + ToggleSwitch { id: enableSDESToggle - labelText: qsTr("Enable SDES(Key Exchange)") - fontPointSize: 10 - - Layout.row: 1 - Layout.column: 0 + labelText: enableSDESText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setUseSDES(checked) } } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 1 - Layout.column: 1 + TextMetrics { + id: enableSDESText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Enable SDES(Key Exchange)") } - // third row - ToggleSwitch{ + ToggleSwitch { id: fallbackRTPToggle - labelText: qsTr("Can Fallback on RTP") - fontPointSize: 10 - - Layout.row: 2 - Layout.column: 0 + labelText: fallbackRTPText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setUseRTPFallback(checked) } } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 2 - Layout.column: 1 + TextMetrics { + id: fallbackRTPText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Can Fallback on RTP") } - // fourth row - ToggleSwitch{ + ToggleSwitch { id: encryptNegotitationToggle - labelText: qsTr("Encrypt Negotiation(TLS)") - fontPointSize: 10 - - Layout.row: 3 - Layout.column: 0 + labelText: encryptNegotitationText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setUseTLS(checked) @@ -660,754 +587,453 @@ ColumnLayout { } } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 3 - Layout.column: 1 + TextMetrics { + id: encryptNegotitationText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Encrypt Negotiation (TLS)") } - // fifth row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 - - Layout.row: 4 - Layout.column: 0 - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - } + GridLayout { + Layout.fillWidth: true - Label{ - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + rowSpacing: 8 + columnSpacing: 8 - Layout.maximumWidth: 209 - Layout.preferredWidth: 209 - Layout.minimumWidth: 209 + rows: 4 + columns: 2 - text: qsTr("CA Certificate") + ElidedTextLabel { + Layout.fillWidth: true - font.pointSize: 10 - font.kerning: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("CA Certificate") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 4 - Layout.column: 1 - } - HoverableRadiusButton{ - id: btnSIPCACert - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - Layout.maximumWidth: 250 - Layout.preferredWidth: 250 - Layout.minimumWidth: 250 + HoverableRadiusButton { + id: btnSIPCACert - radius: height / 2 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - icon.source: "qrc:/images/icons/round-folder-24px.svg" - icon.width: 16 - icon.height: 16 + radius: height / 2 - Layout.row: 4 - Layout.column: 2 + icon.source: "qrc:/images/icons/round-folder-24px.svg" + icon.width: 16 + icon.height: 16 - onClicked: { - caCert_Dialog_SIP.open() + onClicked: { + caCert_Dialog_SIP.open() + } } - } - // sixth row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 - - Layout.row: 5 - Layout.column: 0 + ElidedTextLabel { + Layout.fillWidth: true - Item{ - Layout.fillHeight: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + eText: qsTr("User Certificate") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - Label{ - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + HoverableRadiusButton { + id: btnSIPUserCert - Layout.maximumWidth: 209 - Layout.preferredWidth: 209 - Layout.minimumWidth: 209 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - text: qsTr("User Certificate") + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 - font.kerning: true + radius: height / 2 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - } + icon.source: "qrc:/images/icons/round-folder-24px.svg" + icon.width: 16 + icon.height: 16 - Item{ - Layout.fillHeight: true + onClicked: { + userCert_Dialog_SIP.open() + } + } - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + ElidedTextLabel { + Layout.fillWidth: true - Layout.row: 5 - Layout.column: 1 - } + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - HoverableRadiusButton{ - id: btnSIPUserCert + eText: qsTr("Private Key") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + HoverableRadiusButton { + id: btnSIPPrivateKey - Layout.maximumWidth: 250 - Layout.preferredWidth: 250 - Layout.minimumWidth: 250 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - radius: height / 2 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - icon.source: "qrc:/images/icons/round-folder-24px.svg" - icon.width: 16 - icon.height: 16 + radius: height / 2 - Layout.row: 5 - Layout.column: 2 + icon.source: "qrc:/images/icons/round-folder-24px.svg" + icon.width: 16 + icon.height: 16 - onClicked: { - userCert_Dialog_SIP.open() + onClicked: { + privateKey_Dialog_SIP.open() + } } - } - // seventh row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 - - Layout.row: 6 - Layout.column: 0 + // Private key password + ElidedTextLabel { + Layout.fillWidth: true - Item{ - Layout.fillHeight: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + eText: qsTr("Private Key Password") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - Label{ - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - Layout.maximumWidth: 209 - Layout.preferredWidth: 209 - Layout.minimumWidth: 209 + InfoLineEdit { + id: lineEditSIPCertPassword - text: qsTr("Private Key") + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - } - } + echoMode: TextInput.Password - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 6 - Layout.column: 1 + onEditingFinished: { + ClientWrapper.settingsAdaptor.lineEditSIPCertPasswordLineEditTextChanged(text) + } + } } - HoverableRadiusButton{ - id: btnSIPPrivateKey - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - Layout.maximumWidth: 250 - Layout.preferredWidth: 250 - Layout.minimumWidth: 250 - - radius: height / 2 - - icon.source: "qrc:/images/icons/round-folder-24px.svg" - icon.width: 16 - icon.height: 16 + ToggleSwitch { + id: verifyIncomingCertificatesServerToogle - Layout.row: 6 - Layout.column: 2 + labelText: verifyIncomingCertificatesServerText.elidedText + fontPointSize: JamiTheme.settingsFontSize - onClicked: { - privateKey_Dialog_SIP.open() + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setVerifyCertificatesServer(checked) } } - // eight row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 + TextMetrics { + id: verifyIncomingCertificatesServerText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Verify Certificates (Server Side)") + } - Layout.row: 7 - Layout.column: 0 + ToggleSwitch { + id: verifyIncomingCertificatesClientToogle - Item{ - Layout.fillHeight: true + labelText: verifyIncomingCertificatesClientText.elidedText + fontPointSize: JamiTheme.settingsFontSize - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setVerifyCertificatesClient(checked) } + } - Label{ - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - Layout.maximumWidth: 209 - Layout.preferredWidth: 209 - Layout.minimumWidth: 209 + TextMetrics { + id: verifyIncomingCertificatesClientText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Verify Certificates (Client Side)") + } - text: qsTr("Private Key Password") + ToggleSwitch { + id: requireCeritificateForTLSIncomingToggle - font.pointSize: 10 - font.kerning: true + labelText: requireCeritificateForTLSIncomingText.elidedText + fontPointSize: JamiTheme.settingsFontSize - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setRequireCertificatesIncomingTLS(checked) } } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 7 - Layout.column: 1 + TextMetrics { + id: requireCeritificateForTLSIncomingText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("TLS Connections Require Certificate") } - InfoLineEdit { - id: lineEditSIPCertPassword - Layout.alignment: Qt.AlignCenter + GridLayout { + Layout.fillWidth: true - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 + rowSpacing: 8 + columnSpacing: 8 - font.pointSize: 10 - font.kerning: true + rows: 3 + columns: 2 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - echoMode: TextInput.Password + eText: qsTr("TLS Protocol Method") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - Layout.row: 7 - Layout.column: 2 + SettingParaCombobox { + id: tlsProtocolComboBox - onEditingFinished: { - ClientWrapper.settingsAdaptor.lineEditSIPCertPasswordLineEditTextChanged(text) - } - } + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - // nineth row - ToggleSwitch{ - id: verifyIncomingCertificatesServerToogle + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - labelText: qsTr("Verify Certificates(Server Side)") - fontPointSize: 10 + textRole: "textDisplay" - Layout.row: 8 - Layout.column: 0 + model: ListModel { + ListElement{textDisplay: "Default"; firstArg: "Default"; secondArg: 0} + ListElement{textDisplay: "TLSv1"; firstArg: "TLSv1"; secondArg: 1} + ListElement{textDisplay: "TLSv1.1"; firstArg: "TLSv1.1"; secondArg: 2} + ListElement{textDisplay: "TLSv1.2"; firstArg: "TLSv1.2"; secondArg: 3} + } - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setVerifyCertificatesServer(checked) + onActivated: { + var indexOfOption = tlsProtocolComboBox.model.get(index).secondArg + ClientWrapper.settingsAdaptor.tlsProtocolComboBoxIndexChanged(parseInt(indexOfOption)) + } } - } - Item{ - Layout.fillHeight: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + eText: qsTr("Outgoing TLS Server Name") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - Layout.row: 8 - Layout.column: 1 - } + InfoLineEdit { + id: outgoingTLSServerNameLineEdit - // tenth row - ToggleSwitch{ - id: verifyIncomingCertificatesClientToogle + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - labelText: qsTr("Verify Certificates(Client Side)") - fontPointSize: 10 + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - Layout.row: 9 - Layout.column: 0 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setVerifyCertificatesClient(checked) + onEditingFinished: { + ClientWrapper.settingsAdaptor.outgoingTLSServerNameLineEditTextChanged(text) + } } - } - Item{ - Layout.fillHeight: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + eText: qsTr("Negotiation Timeout (seconds)") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - Layout.row: 9 - Layout.column: 1 - } + SpinBox { + id: negotiationTimeoutSpinBox - //eleventh row - ToggleSwitch{ - id: requireCeritificateForTLSIncomingToggle + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - labelText: qsTr("TLS Connections Require Certificate") - fontPointSize: 10 + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true + + from: 0 + to: 3000 + stepSize: 1 - Layout.row: 10 - Layout.column: 0 + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setRequireCertificatesIncomingTLS(checked) + onValueModified: { + ClientWrapper.settingsAdaptor.negotiationTimeoutSpinBoxValueChanged(value) + } } } + } + } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row:10 - Layout.column: 1 - } + // connectivity section + ColumnLayout { + spacing: 8 + Layout.fillWidth: true - // twelveth row - Label{ - Layout.fillWidth: true + ElidedTextLabel { + Layout.fillWidth: true - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - text: qsTr("TLS Protocol Method") - font.pointSize: 10 - font.kerning: true + eText: qsTr("Connectivity") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredSettingsWidth + } - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + GridLayout { + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Layout.row: 11 - Layout.column: 0 - } + rowSpacing: 8 + columnSpacing: 8 - Item{ - Layout.fillHeight: true + rows: 9 + columns: 2 - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.row: 11 - Layout.column: 1 + eText: qsTr("Registration Expire Timeout (seconds)") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - SettingParaCombobox{ - id:tlsProtocolComboBox - Layout.maximumWidth: 252 - Layout.preferredWidth: 252 - Layout.minimumWidth: 252 + SpinBox { + id: registrationExpireTimeoutSpinBox - Layout.maximumHeight: 29 - Layout.minimumHeight: 29 - Layout.preferredHeight: 29 + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.alignment: Qt.AlignCenter - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true - Layout.row: 11 - Layout.column: 2 - - textRole: "textDisplay" + from: 0 + to: 3000 + stepSize: 1 - model: ListModel{ - ListElement{textDisplay: "Default"; firstArg: "Default"; secondArg: 0} - ListElement{textDisplay: "TLSv1"; firstArg: "TLSv1"; secondArg: 1} - ListElement{textDisplay: "TLSv1.1"; firstArg: "TLSv1.1"; secondArg: 2} - ListElement{textDisplay: "TLSv1.2"; firstArg: "TLSv1.2"; secondArg: 3} - } + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 - onActivated: { - var indexOfOption = tlsProtocolComboBox.model.get(index).secondArg - ClientWrapper.settingsAdaptor.tlsProtocolComboBoxIndexChanged(parseInt(indexOfOption)) + onValueModified: { + ClientWrapper.settingsAdaptor.registrationTimeoutSpinBoxValueChanged(value) } } - // 13th row - Label{ + // 2nd row + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + eText: qsTr("Newtwork interface") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - text: qsTr("Outgoing TLS Server Name") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + SpinBox { + id: networkInterfaceSpinBox - Layout.row: 12 - Layout.column: 0 - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 12 - Layout.column: 1 - } - - InfoLineEdit { - id: outgoingTLSServerNameLineEdit + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.alignment: Qt.AlignCenter - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 12 - Layout.column: 2 - - onEditingFinished: { - ClientWrapper.settingsAdaptor.outgoingTLSServerNameLineEditTextChanged(text) - } - } - - // 14th row - Label{ - Layout.fillWidth: true - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - text: qsTr("Negotiation Timeout(seconds)") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 13 - Layout.column: 0 - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 13 - Layout.column: 1 - } - - SpinBox{ - id:negotiationTimeoutSpinBox - - Layout.maximumWidth: 252 - Layout.preferredWidth: 252 - Layout.minimumWidth: 252 - - Layout.maximumHeight: 30 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - - Layout.alignment: Qt.AlignCenter - - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true from: 0 - to: 3000 + to: 65536 stepSize: 1 - Layout.row: 13 - Layout.column: 2 + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 onValueModified: { - ClientWrapper.settingsAdaptor.negotiationTimeoutSpinBoxValueChanged(value) + ClientWrapper.settingsAdaptor.networkInterfaceSpinBoxValueChanged(value) } } - } - } - - Item{ - Layout.fillWidth: true - - Layout.maximumHeight: 20 - Layout.preferredHeight: 20 - Layout.minimumHeight: 20 - } - - // connectivity section - ColumnLayout{ - spacing: 6 - Layout.fillWidth: true - - Label { - Layout.fillWidth: true - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Connectivity") - - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 - } - - GridLayout{ - Layout.leftMargin: 20 - Layout.fillWidth: true - - rowSpacing: 6 - columnSpacing: 6 - - rows: 9 - columns: 3 - - // 1st row - Label{ - Layout.minimumWidth: 286 - Layout.preferredWidth: 286 - - Layout.minimumHeight: 28 - Layout.preferredHeight: 28 - Layout.maximumHeight: 28 - - text: qsTr("Registration Expire Timeout(seconds)") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 0 - Layout.column: 0 - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 0 - Layout.column: 1 - } - - SpinBox{ - id: registrationExpireTimeoutSpinBox - - Layout.maximumWidth: 250 - Layout.preferredWidth: 250 - Layout.minimumWidth: 250 - - Layout.maximumHeight: 30 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - - Layout.alignment: Qt.AlignCenter - - font.pointSize: 10 - font.kerning: true - - from: 0 - to: 3000 - stepSize: 1 - - Layout.row: 0 - Layout.column: 2 - - onValueModified: { - ClientWrapper.settingsAdaptor.registrationTimeoutSpinBoxValueChanged(value) - } - } - - // 2nd row - Label{ - Layout.minimumWidth: 286 - Layout.preferredWidth: 286 - - Layout.minimumHeight: 28 - Layout.preferredHeight: 28 - Layout.maximumHeight: 28 - - text: qsTr("Newtwork interface") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 1 - Layout.column: 0 - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 1 - Layout.column: 1 - } - - SpinBox{ - id: networkInterfaceSpinBox - - Layout.maximumWidth: 250 - Layout.preferredWidth: 250 - Layout.minimumWidth: 250 - - Layout.maximumHeight: 30 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - - Layout.alignment: Qt.AlignCenter - - font.pointSize: 10 - font.kerning: true - - from: 0 - to: 65536 - stepSize: 1 - - Layout.row: 1 - Layout.column: 2 - - onValueModified: { - ClientWrapper.settingsAdaptor.networkInterfaceSpinBoxValueChanged(value) - } - } // 3rd row - ToggleSwitch{ + ToggleSwitch { id: checkBoxUPnPSIP labelText: qsTr("Use UPnP") - fontPointSize: 10 + fontPointSize: JamiTheme.settingsFontSize - Layout.row: 2 - Layout.column: 0 + Layout.columnSpan: 2 onSwitchToggled: { ClientWrapper.settingsAdaptor.setUseUPnP(checked) } } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 2 - Layout.column: 1 - } - // 4th row - ToggleSwitch{ + ToggleSwitch { id: checkBoxTurnEnableSIP labelText: qsTr("Use TURN") - fontPointSize: 10 + fontPointSize: JamiTheme.settingsFontSize - Layout.row: 3 - Layout.column: 0 + Layout.columnSpan: 2 onSwitchToggled: { ClientWrapper.settingsAdaptor.setUseTURN(checked) @@ -1418,217 +1044,87 @@ ColumnLayout { } } - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 3 - Layout.column: 1 - } - // 5th row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 - - Layout.row: 4 - Layout.column: 0 - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - } - - Label{ - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 - - Layout.maximumWidth: 260 - Layout.preferredWidth: 260 - Layout.minimumWidth: 260 - - text: qsTr("TURN Address") - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.row: 4 - Layout.column: 1 + text: qsTr("TURN Address") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - InfoLineEdit { id: lineEditTurnAddressSIP - Layout.alignment: Qt.AlignCenter - - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.row: 4 - Layout.column: 2 - onEditingFinished: { ClientWrapper.settingsAdaptor.setTURNAddress(text) } } // 6th row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 - - Layout.row: 5 - Layout.column: 0 - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - } - - Label{ - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 - - Layout.maximumWidth: 260 - Layout.preferredWidth: 260 - Layout.minimumWidth: 260 - - text: qsTr("TURN Username") - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.row: 5 - Layout.column: 1 + eText: qsTr("TURN Username") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditTurnUsernameSIP - Layout.alignment: Qt.AlignCenter - - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.row: 5 - Layout.column: 2 - onEditingFinished: { ClientWrapper.settingsAdaptor.setTURNUsername(text) } } - // 7th row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 - - Layout.row: 6 - Layout.column: 0 - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - } - - Label{ - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 - - Layout.maximumWidth: 260 - Layout.preferredWidth: 260 - Layout.minimumWidth: 260 - - text: qsTr("TURN Password") - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.row: 6 - Layout.column: 1 + eText: qsTr("TURN Password") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditTurnPsswdSIP - Layout.alignment: Qt.AlignCenter + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 - - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.row: 6 - Layout.column: 2 - echoMode: TextInput.Password onEditingFinished: { @@ -1637,918 +1133,656 @@ ColumnLayout { } // 8th row - RowLayout{ - spacing: 6 - Layout.maximumHeight: 30 - - Layout.row: 7 - Layout.column: 0 - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - } - - Label{ - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 - - Layout.maximumWidth: 260 - Layout.preferredWidth: 260 - Layout.minimumWidth: 260 - - text: qsTr("TURN Realm") - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.row: 7 - Layout.column: 1 + eText: qsTr("TURN Realm") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditTurnRealmSIP - Layout.alignment: Qt.AlignCenter - - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.row: 7 - Layout.column: 2 - onEditingFinished: { ClientWrapper.settingsAdaptor.setTURNRealm(text) - } - } - - // 9th row - ToggleSwitch{ - id: checkBoxSTUNEnableSIP - - labelText: qsTr("Use STUN") - fontPointSize: 10 - - Layout.row: 8 - Layout.column: 0 - - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setUseSTUN(checked) - lineEditSTUNAddressSIP.enabled = checked - } - } - - Item{ - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - - Layout.row: 8 - Layout.column: 1 - } - - InfoLineEdit { - id: lineEditSTUNAddressSIP - - Layout.alignment: Qt.AlignCenter - - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 8 - Layout.column: 2 - - onEditingFinished: { - ClientWrapper.settingsAdaptor.setSTUNAddress(text) - } - } - } - } - - Item{ - Layout.fillWidth: true - - Layout.maximumHeight: 20 - Layout.preferredHeight: 20 - Layout.minimumHeight: 20 - } - - // public address section - ColumnLayout{ - spacing: 6 - Layout.fillWidth: true - - Label { - Layout.fillWidth: true - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Public Address") - - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 - } - - GridLayout{ - Layout.leftMargin: 20 - Layout.fillWidth: true - - rowSpacing: 6 - columnSpacing: 6 - - rows: 3 - columns: 3 - - // 1st row - ToggleSwitch{ - id: checkBoxCustomAddressPort - - Layout.maximumWidth: 88 - labelText: qsTr("Use Custom Address/Port") - fontPointSize: 10 - - Layout.row: 0 - Layout.column: 0 - - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setUseCustomAddressAndPort(checked) - lineEditSIPCustomAddress.enabled = checked - customPortSIPSpinBox.enabled = checked - } - } - - Item{ - Layout.fillHeight: true - Layout.fillWidth: true - - Layout.row: 0 - Layout.column: 1 - } - - //2nd row - Label{ - Layout.leftMargin: 26 - - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 - - Layout.maximumWidth: 60 - Layout.preferredWidth: 60 - Layout.minimumWidth: 60 - - text: qsTr("Address") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 1 - Layout.column: 0 - } - - Item{ - Layout.fillHeight: true - Layout.fillWidth: true - - Layout.row: 1 - Layout.column: 1 - } - - InfoLineEdit { - id: lineEditSIPCustomAddress - - Layout.alignment: Qt.AlignCenter - - fieldLayoutWidth: 250 - fieldLayoutHeight: 29 + } + } - font.pointSize: 10 - font.kerning: true + // 9th row + ToggleSwitch { + id: checkBoxSTUNEnableSIP - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + labelText: qsTr("Use STUN") + fontPointSize: JamiTheme.settingsFontSize - Layout.row: 1 - Layout.column: 2 + Layout.columnSpan: 2 - onEditingFinished: { - ClientWrapper.settingsAdaptor.lineEditSIPCustomAddressLineEditTextChanged(text) - } + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setUseSTUN(checked) + lineEditSTUNAddressSIP.enabled = checked } + } + + // 10th row + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - //3rd row - Label{ - Layout.leftMargin: 26 + eText: qsTr("STUN Address") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 + InfoLineEdit { + id: lineEditSTUNAddressSIP - Layout.maximumWidth: 60 - Layout.preferredWidth: 60 - Layout.minimumWidth: 60 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - text: qsTr("Port") - font.pointSize: 10 - font.kerning: true + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter - Layout.row: 2 - Layout.column: 0 + onEditingFinished: { + ClientWrapper.settingsAdaptor.setSTUNAddress(text) } + } + } + } - Item{ - Layout.fillHeight: true - Layout.fillWidth: true - Layout.row: 2 - Layout.column: 1 - } + // public address section + ColumnLayout { + spacing: 8 + Layout.fillWidth: true - SpinBox{ - id: customPortSIPSpinBox + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + text: qsTr("Public Address") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredSettingsWidth + } - Layout.maximumWidth: 250 - Layout.preferredWidth: 250 - Layout.minimumWidth: 250 + GridLayout { + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Layout.maximumHeight: 30 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 + rowSpacing: 8 + columnSpacing: 8 - Layout.alignment: Qt.AlignCenter + rows: 3 + columns: 2 - font.pointSize: 10 - font.kerning: true + // 1st row + ToggleSwitch { + id: checkBoxCustomAddressPort - from: 0 - to: 65535 - stepSize: 1 + labelText: checkBoxCustomAddressPortText.elidedText + fontPointSize: JamiTheme.settingsFontSize - Layout.row: 2 - Layout.column: 2 + Layout.columnSpan: 2 - onValueModified: { - ClientWrapper.settingsAdaptor.customPortSIPSpinBoxValueChanged(value) - } + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setUseCustomAddressAndPort(checked) + lineEditSIPCustomAddress.enabled = checked + customPortSIPSpinBox.enabled = checked } } - } - // media section - ColumnLayout{ - spacing: 6 - Layout.fillWidth: true + TextMetrics { + id: checkBoxCustomAddressPortText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Use Custom Address/Port") + } + + //2nd row + ElidedTextLabel { + Layout.leftMargin: JamiTheme.preferredMarginSize - Label { Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 + eText: qsTr("Address") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } + + InfoLineEdit { + id: lineEditSIPCustomAddress - text: qsTr("Media") + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 13 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter + + onEditingFinished: { + ClientWrapper.settingsAdaptor.lineEditSIPCustomAddressLineEditTextChanged(text) + } } - Item { + //3rd row + ElidedTextLabel { + Layout.leftMargin: JamiTheme.preferredMarginSize + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 + eText: qsTr("Port") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - ColumnLayout { - spacing: 6 - Layout.fillWidth: true + SpinBox { + id: customPortSIPSpinBox - ToggleSwitch { - id: videoCheckBoxSIP + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.leftMargin: 20 + Layout.alignment: Qt.AlignCenter - labelText: qsTr("Enable Video") - fontPointSize: 10 + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setVideoState(checked) - } - } + from: 0 + to: 65535 + stepSize: 1 - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.leftMargin: 20 + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 - ColumnLayout { - spacing: 6 - Layout.maximumWidth: 348 + onValueModified: { + ClientWrapper.settingsAdaptor.customPortSIPSpinBoxValueChanged(value) + } + } + } + } - RowLayout { - spacing: 6 - Layout.fillWidth: true + // media section + ColumnLayout { + spacing: 8 + Layout.fillWidth: true - Layout.maximumHeight: 30 + Label { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Label { - Layout.fillWidth: true + text: qsTr("Media") - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + font.pointSize: JamiTheme.headerFontSize + font.kerning: true - text: qsTr("Video Codecs") - font.pointSize: 10 - font.kerning: true + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + ColumnLayout { + spacing: 8 + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Item { - Layout.fillHeight: true + ToggleSwitch { + id: videoCheckBoxSIP - Layout.minimumWidth: 20 - Layout.preferredWidth: 20 - Layout.maximumWidth: 20 - } + labelText: videoCheckBoxSIPText.elidedText + fontPointSize: JamiTheme.settingsFontSize - HoverableRadiusButton { - id: videoDownPushButtonSIP + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setVideoState(checked) + } + } - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 + TextMetrics { + id: videoCheckBoxSIPText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Enable Video") + } - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - radius: height / 2 - scale: 1 + RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true - buttonImageHeight: height - buttonImageWidth: height + ColumnLayout { + Layout.fillWidth: true + Layout.fillHeight: true - font.pointSize: 9 - font.kerning: true + RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg" - icon.width: 32 - icon.height: 32 + ElidedTextLabel { + Layout.fillWidth: true - onClicked: { - decreaseVideoCodecPriority() - } - } + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - HoverableRadiusButton { - id: videoUpPushButtonSIP + maxWidth: preferredColumnWidth - 50 + eText: qsTr("Video Codecs") + fontSize: JamiTheme.settingsFontSize + } - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + HoverableRadiusButton { + id: videoDownPushButtonSIP - radius: height / 2 + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 - buttonImageHeight: height - buttonImageWidth: height + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - font.pointSize: 9 - font.kerning: true + buttonImageHeight: height + buttonImageWidth: height + radius: height / 2 - icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg" - icon.width: 32 - icon.height: 32 + icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg" + icon.width: 24 + icon.height: 24 - onClicked: { - increaseVideoCodecPriority() - } + onClicked: { + decreaseVideoCodecPriority() } } - ListViewJami { - id: videoListWidgetSIP - - Layout.minimumWidth: 348 - Layout.preferredWidth: 348 - Layout.maximumWidth: 348 + HoverableRadiusButton { + id: videoUpPushButtonSIP - Layout.minimumHeight: 192 - Layout.preferredHeight: 192 - Layout.maximumHeight: 192 + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 - model: videoCodecListModelSIP + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - delegate: VideoCodecDelegate { - id: videoCodecDelegate + buttonImageHeight: height + buttonImageWidth: height + radius: height / 2 - width: videoListWidgetSIP.width - height: videoListWidgetSIP.height / 4 + icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg" + icon.width: 24 + icon.height: 24 - videoCodecName : VideoCodecName - isEnabled : IsEnabled - videoCodecId: VideoCodecID - - onClicked: { - videoListWidgetSIP.currentIndex = index - } - - onVideoCodecStateChange:{ - ClientWrapper.settingsAdaptor.videoCodecsStateChange(idToSet , isToBeEnabled) - updateVideoCodecs() - } + onClicked: { + increaseVideoCodecPriority() } } } - ColumnLayout { - spacing: 6 - Layout.maximumWidth: 348 + ListViewJami { + id: videoListWidgetSIP - RowLayout { - spacing: 6 - Layout.fillWidth: true + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - Layout.maximumHeight: 30 + Layout.minimumHeight: 192 + Layout.preferredHeight: 192 + Layout.maximumHeight: 192 - Label { - Layout.fillWidth: true + model: videoCodecListModelSIP - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + delegate: VideoCodecDelegate { + id: videoCodecDelegate - text: qsTr("Audio Codecs") - font.pointSize: 10 - font.kerning: true + width: videoListWidgetSIP.width + height: videoListWidgetSIP.height / 4 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + videoCodecName : VideoCodecName + isEnabled : IsEnabled + videoCodecId: VideoCodecID - Item { - Layout.fillHeight: true + onClicked: { + videoListWidget.currentIndex = index + } - Layout.minimumWidth: 20 - Layout.preferredWidth: 20 - Layout.maximumWidth: 20 + onVideoCodecStateChange:{ + ClientWrapper.settingsAdaptor.videoCodecsStateChange(idToSet , isToBeEnabled) + updateVideoCodecs() } + } + } + } - HoverableRadiusButton { - id: audioDownPushButtonSIP + ColumnLayout { + Layout.fillWidth: true - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 + RowLayout { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + ElidedTextLabel { + Layout.fillWidth: true - radius: height / 2 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - buttonImageHeight: height - buttonImageWidth: height + maxWidth: preferredColumnWidth - 50 + eText: qsTr("Audio Codecs") + fontSize: JamiTheme.settingsFontSize + } - font.pointSize: 9 - font.kerning: true - icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg" - icon.width: 32 - icon.height: 32 + HoverableRadiusButton { + id: audioDownPushButtonSIP - onClicked: { - decreaseAudioCodecPriority() - } - } + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 - HoverableRadiusButton { - id: audioUpPushButtonSIP + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 + radius: height / 2 + buttonImageHeight: height + buttonImageWidth: height - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg" + icon.width: 24 + icon.height: 24 - radius: height / 2 + onClicked: { + decreaseAudioCodecPriority() + } + } + + HoverableRadiusButton { + id: audioUpPushButtonSIP + + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 - buttonImageHeight: height - buttonImageWidth: height + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - font.pointSize: 9 - font.kerning: true + radius: height / 2 + buttonImageHeight: height + buttonImageWidth: height - icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg" - icon.width: 32 - icon.height: 32 + icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg" + icon.width: 24 + icon.height: 24 - onClicked: { - increaseAudioCodecPriority() - } + onClicked: { + increaseAudioCodecPriority() } } + } - ListViewJami { - id: audioListWidgetSIP + ListViewJami { + id: audioListWidgetSIP - Layout.minimumWidth: 348 - Layout.preferredWidth: 348 - Layout.maximumWidth: 348 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: 192 - Layout.preferredHeight: 192 - Layout.maximumHeight: 192 + Layout.minimumHeight: 192 + Layout.preferredHeight: 192 + Layout.maximumHeight: 192 - model: audioCodecListModelSIP + model: audioCodecListModelSIP - delegate: AudioCodecDelegate { - id: audioCodecDelegate + delegate: AudioCodecDelegate { + id: audioCodecDelegate - width: audioListWidgetSIP.width - height: audioListWidgetSIP.height / 4 + width: audioListWidgetSIP.width + height: audioListWidgetSIP.height / 4 - layer.mipmap: false - clip: true + layer.mipmap: false + clip: true - audioCodecName : AudioCodecName - isEnabled : IsEnabled - audioCodecId: AudioCodecID - samplerRate: Samplerate + audioCodecName : AudioCodecName + isEnabled : IsEnabled + audioCodecId: AudioCodecID + samplerRate: Samplerate - onClicked: { - audioListWidgetSIP.currentIndex = index - } + onClicked: { + audioListWidget.currentIndex = index + } - onAudioCodecStateChange:{ - ClientWrapper.settingsAdaptor.audioCodecsStateChange(idToSet , isToBeEnabled) - updateAudioCodecs() - } + onAudioCodecStateChange:{ + ClientWrapper.settingsAdaptor.audioCodecsStateChange(idToSet , isToBeEnabled) + updateAudioCodecs() } } } } } - } + } - Item { + // SDP Session + ColumnLayout { + spacing: 8 + Layout.fillWidth: true + + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 20 - Layout.preferredHeight: 20 - Layout.minimumHeight: 20 + eText: qsTr("SDP Session Negotiation (ICE Fallback)") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredSettingsWidth } - ColumnLayout{ - spacing: 6 + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.leftMargin: JamiTheme.preferredMarginSize + + eText: qsTr("Only used during negotiation in case ICE is not supported") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredSettingsWidth + } - Label { - Layout.fillWidth: true + GridLayout { + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 + rowSpacing: 8 + columnSpacing: 8 - text: qsTr("SDP Session Negotiation(ICE Fallback)") + rows: 4 + columns: 2 - font.pointSize: 13 - font.kerning: true + // 1st row + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Audio RTP Min Port") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - Label { - Layout.fillWidth: true - - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 + SpinBox { + id:audioRTPMinPortSpinBox - text: qsTr("Only used during negotiation in case ICE is not supported") + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + from: 0 + to: 65535 + stepSize: 1 - Item { - Layout.fillWidth: true + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 + onValueModified: { + audioRTPMinPortSpinBoxEditFinished(value) + } } - GridLayout{ - Layout.leftMargin: 20 + // 2nd row + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - rowSpacing: 6 - columnSpacing: 6 - - rows: 4 - columns: 3 - - // 1st row - Label{ - Layout.minimumWidth: 162 - Layout.preferredWidth: 162 - Layout.maximumWidth: 162 - - Layout.minimumHeight: 28 - Layout.preferredHeight: 28 - Layout.maximumHeight: 28 - - text: qsTr("Audio RTP Min Port") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 0 - Layout.column: 0 - } - - Item{ - Layout.fillHeight: true - Layout.fillWidth: true - - Layout.row: 0 - Layout.column: 1 - } - - SpinBox{ - id:audioRTPMinPortSpinBox - - Layout.minimumWidth: 250 - Layout.preferredWidth: 250 - Layout.maximumWidth: 250 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - font.pointSize: 10 - font.kerning: true - - from: 0 - to: 65535 - stepSize: 1 - - Layout.row: 0 - Layout.column: 2 - - onValueModified: { - audioRTPMinPortSpinBoxEditFinished(value) - } - } - - // 2nd row - Label{ - Layout.minimumWidth: 162 - Layout.preferredWidth: 162 - Layout.maximumWidth: 162 - - Layout.minimumHeight: 28 - Layout.preferredHeight: 28 - Layout.maximumHeight: 28 - - text: qsTr("Audio RTP Max Port") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - Layout.row: 1 - Layout.column: 0 - } - - Item{ - Layout.fillHeight: true - Layout.fillWidth: true - - Layout.row: 1 - Layout.column: 1 - } - - SpinBox{ - id:audioRTPMaxPortSpinBox - - Layout.minimumWidth: 250 - Layout.preferredWidth: 250 - Layout.maximumWidth: 250 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - font.pointSize: 10 - font.kerning: true - - from: 0 - to: 65535 - stepSize: 1 - - Layout.row: 1 - Layout.column: 2 - - onValueModified: { - audioRTPMaxPortSpinBoxEditFinished(value) - } - } - - // 3rd row - Label{ - Layout.minimumWidth: 162 - Layout.preferredWidth: 162 - Layout.maximumWidth: 162 + eText: qsTr("Audio RTP Max Port") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - Layout.minimumHeight: 28 - Layout.preferredHeight: 28 - Layout.maximumHeight: 28 + SpinBox { + id:audioRTPMaxPortSpinBox - text: qsTr("Video RTP Min Port") - font.pointSize: 10 - font.kerning: true + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - Layout.row: 2 - Layout.column: 0 - } + from: 0 + to: 65535 + stepSize: 1 - Item{ - Layout.fillHeight: true - Layout.fillWidth: true + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 - Layout.row: 2 - Layout.column: 1 + onValueModified: { + audioRTPMaxPortSpinBoxEditFinished(value) } + } - SpinBox{ - id:videoRTPMinPortSpinBox - - Layout.minimumWidth: 250 - Layout.preferredWidth: 250 - Layout.maximumWidth: 250 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - font.pointSize: 10 - font.kerning: true - - from: 0 - to: 65535 - stepSize: 1 + // 3rd row + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.row: 2 - Layout.column: 2 + eText: qsTr("Video RTP Min Port") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - onValueModified: { - videoRTPMinPortSpinBoxEditFinished(value) - } - } + SpinBox { + id:videoRTPMinPortSpinBox - // 4th row - Label{ - Layout.minimumWidth: 162 - Layout.preferredWidth: 162 - Layout.maximumWidth: 162 + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 28 - Layout.preferredHeight: 28 - Layout.maximumHeight: 28 + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - text: qsTr("Video RTP Max Port") - font.pointSize: 10 - font.kerning: true + from: 0 + to: 65535 + stepSize: 1 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 - Layout.row: 3 - Layout.column: 0 + onValueModified: { + videoRTPMinPortSpinBoxEditFinished(value) } + } - Item{ - Layout.fillHeight: true - Layout.fillWidth: true - - Layout.row: 3 - Layout.column: 1 - } + // 4th row + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - SpinBox{ - id:videoRTPMaxPortSpinBox + eText: qsTr("Video RTP Max Port") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - Layout.minimumWidth: 250 - Layout.preferredWidth: 250 - Layout.maximumWidth: 250 + SpinBox { + id:videoRTPMaxPortSpinBox - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.maximumWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 - font.kerning: true + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - from: 0 - to: 65535 - stepSize: 1 + from: 0 + to: 65535 + stepSize: 1 - Layout.row: 3 - Layout.column: 2 + up.indicator.width: (width < 200) ? (width / 5) : 40 + down.indicator.width: (width < 200) ? (width / 5) : 40 - onValueModified: { - videoRTPMaxPortSpinBoxEditFinished(value) - } + onValueModified: { + videoRTPMaxPortSpinBoxEditFinished(value) } } } - - // spacers - Item { - Layout.fillWidth: true - - Layout.maximumHeight: 48 - Layout.preferredHeight: 48 - Layout.minimumHeight: 48 - } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + } } diff --git a/src/settingsview/components/AdvancedSettingsView.qml b/src/settingsview/components/AdvancedSettingsView.qml index 003869b9b..0510145d0 100644 --- a/src/settingsview/components/AdvancedSettingsView.qml +++ b/src/settingsview/components/AdvancedSettingsView.qml @@ -262,105 +262,112 @@ ColumnLayout { } } - spacing: 6 + id: advancedSettingsViewLayout + Layout.fillWidth: true - Layout.preferredWidth: 532 - Layout.maximumWidth: 532 - - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 24 - Layout.preferredHeight: 24 - Layout.maximumHeight: 24 - } + property int preferredColumnWidth : accountViewRect.width / 2 - 50 ColumnLayout { - spacing: 6 + + spacing: 8 Layout.fillWidth: true - Label { + ElidedTextLabel { Layout.fillWidth: true - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Call Settings") - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + eText: qsTr("Call Settings") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } ColumnLayout { - spacing: 6 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize ToggleSwitch { id: checkBoxUntrusted - Layout.leftMargin: 20 - - labelText: qsTr("Allow incoming calls from unknown contacts") - fontPointSize: 10 + labelText: allowIncomingCallsText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setCallsUntrusted(checked) } } + TextMetrics { + id: allowIncomingCallsText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Allow incoming calls from unknown contacts") + } + ToggleSwitch { id: checkBoxAutoAnswer Layout.fillWidth: true - Layout.leftMargin: 20 - labelText: qsTr("Auto Answer Calls") - fontPointSize: 10 + labelText: autoAnswerCallsElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setAutoAnswerCalls(checked) } } + TextMetrics { + id: autoAnswerCallsElidedText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Auto Answer Calls") + } + + ToggleSwitch { + id: checkBoxCustomRingtone + + labelText: enableCustomRingtoneElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize + + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setEnableRingtone(checked) + btnRingtone.enabled = checked + } + } + + TextMetrics { + id: enableCustomRingtoneElidedText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Enable Custom Ringtone") + } + RowLayout { - spacing: 6 Layout.fillWidth: true - Layout.leftMargin: 20 - Layout.maximumHeight: 30 - ToggleSwitch { - id: checkBoxCustomRingtone - - labelText: qsTr("Enable Custom Ringtone") - fontPointSize: 10 + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setEnableRingtone(checked) - btnRingtone.enabled = checked - } + eText: qsTr("Select Custom Ringtone") + maxWidth: preferredColumnWidth + fontSize: JamiTheme.settingsFontSize } HoverableRadiusButton { id: btnRingtone - Layout.minimumWidth: 300 - Layout.preferredWidth: 300 - Layout.maximumWidth: 300 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight radius: height / 2 @@ -376,60 +383,35 @@ ColumnLayout { } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true - Label { - Layout.fillWidth: true - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Name Server") - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + eText: qsTr("Name Server") + maxWidth: preferredColumnWidth + fontSize: JamiTheme.headerFontSize } RowLayout { Layout.fillWidth: true - Layout.leftMargin: 20 - Layout.maximumHeight: 29 - - Label { - Layout.minimumWidth: 60 - - Layout.minimumHeight: 29 - Layout.preferredHeight: 29 - Layout.maximumHeight: 29 + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.leftMargin: JamiTheme.preferredMarginSize - text: qsTr("Address") - - font.pointSize: 10 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Address") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } Item { @@ -440,13 +422,12 @@ ColumnLayout { InfoLineEdit { id: lineEditNameServer - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter onEditingFinished: { @@ -456,74 +437,59 @@ ColumnLayout { } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true - Label { - Layout.fillWidth: true - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("OpenDHT Configuration") - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + eText: qsTr("OpenDHT Configuration") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } ColumnLayout { - spacing: 6 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.leftMargin: 20 - - ToggleSwitch { - id: checkBoxEnableProxy + ToggleSwitch { + id: checkBoxEnableProxy - labelText: qsTr("Enable proxy") - fontPointSize: 10 + labelText: qsTr("Enable proxy") + fontPointSize: JamiTheme.settingsFontSize - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setEnableProxy(checked) - lineEditProxy.enabled = checked - } + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setEnableProxy(checked) + lineEditProxy.enabled = checked } + } - Item { - Layout.fillHeight: true + RowLayout { + Layout.fillWidth: true + + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + text: qsTr("Proxy Address") + font.pointSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditProxy - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft @@ -536,23 +502,17 @@ ColumnLayout { } RowLayout { - spacing: 6 Layout.fillWidth: true - Layout.leftMargin: 20 - - Label { - id: labelBootstrap - - Layout.minimumWidth: 72 - Layout.preferredWidth: 72 - Layout.minimumHeight: 29 - Layout.preferredHeight: 29 - Layout.maximumHeight: 29 + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight text: qsTr("Bootstrap") - font.pointSize: 10 - font.kerning: true + font.pointSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } Item { @@ -563,10 +523,10 @@ ColumnLayout { InfoLineEdit { id: lineEditBootstrap - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft @@ -581,73 +541,56 @@ ColumnLayout { } ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true - Label { - Layout.fillWidth: true - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Security") - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + eText: qsTr("Security") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } ColumnLayout { - spacing: 6 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize GridLayout { rows: 4 columns: 2 - rowSpacing: 0 - columnSpacing: 6 + rowSpacing: 8 + columnSpacing: 8 Layout.fillWidth: true - Layout.leftMargin: 20 // CA Certificate - Label { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 32 - Layout.preferredHeight: 32 - Layout.maximumHeight: 32 - - text: qsTr("CA Certificate") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("CA Certificate") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } HoverableRadiusButton { id: btnCACert - radius: height / 2 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - Layout.minimumWidth: 298 - Layout.preferredWidth: 298 - Layout.maximumWidth: 298 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + radius: height / 2 icon.source: "qrc:/images/icons/round-folder-24px.svg" icon.width: 16 @@ -659,33 +602,29 @@ ColumnLayout { } // User Certificate - Label { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 32 - Layout.preferredHeight: 32 - Layout.maximumHeight: 32 - - text: qsTr("User Certificate") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("User Certificate") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } HoverableRadiusButton { id: btnUserCert - radius: height / 2 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - Layout.minimumWidth: 298 - Layout.preferredWidth: 298 - Layout.maximumWidth: 298 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + radius: height / 2 icon.source: "qrc:/images/icons/round-folder-24px.svg" icon.width: 16 @@ -697,33 +636,31 @@ ColumnLayout { } // Private Key - Label { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 32 - Layout.preferredHeight: 32 - Layout.maximumHeight: 32 + eText: qsTr("Private Key") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - text: qsTr("Private Key") - font.pointSize: 10 - font.kerning: true - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } HoverableRadiusButton { id: btnPrivateKey radius: height / 2 - Layout.minimumWidth: 298 - Layout.preferredWidth: 298 - Layout.maximumWidth: 298 + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight icon.source: "qrc:/images/icons/round-folder-24px.svg" icon.width: 16 @@ -735,28 +672,25 @@ ColumnLayout { } // Private key password - Label { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 29 - Layout.preferredHeight: 29 - Layout.maximumHeight: 29 - - text: qsTr("Private Key Password") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Private Key Password") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } + InfoLineEdit { id: lineEditCertPassword - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft @@ -767,152 +701,94 @@ ColumnLayout { } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true - Label { + ElidedTextLabel { Layout.fillWidth: true - Layout.topMargin: 10 + Layout.topMargin: JamiTheme.preferredMarginSize - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("Connectivity") - font.pointSize: 13 - font.kerning: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + eText: qsTr("Connectivity") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } ColumnLayout { - spacing: 6 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - GridLayout { - Layout.leftMargin: 20 - Layout.fillWidth: true - - rows: 6 - columns: 3 - rowSpacing: 6 - columnSpacing: 6 - - // row 2 - ToggleSwitch { - id: checkAutoConnectOnLocalNetwork - - Layout.row: 0 - Layout.column: 0 - - labelText: qsTr("Auto Connect On Local Network") - fontPointSize: 10 - - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setAutoConnectOnLocalNetwork(checked) - } - } + ToggleSwitch { + id: checkAutoConnectOnLocalNetwork - Item { - Layout.row: 0 - Layout.column: 1 + Layout.fillWidth: true - Layout.fillHeight: true + labelText: autoConnectOnLocalNetworkElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize - Layout.minimumWidth: 40 - Layout.preferredWidth: 40 - Layout.maximumWidth: 40 + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setAutoConnectOnLocalNetwork(checked) } + } - // row 2 - ToggleSwitch { - id: checkBoxUPnP - - Layout.row: 1 - Layout.column: 0 - - labelText: qsTr("Use UPnP") - fontPointSize: 10 + TextMetrics { + id: autoConnectOnLocalNetworkElidedText + elide: Text.ElideRight + elideWidth: preferredColumnWidth + text: qsTr("Auto Connect On Local Network") + } - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setUseUPnP(checked) - } - } + ToggleSwitch { + id: checkBoxUPnP - Item { - Layout.row: 1 - Layout.column: 1 + Layout.fillWidth: true - Layout.fillHeight: true + labelText: qsTr("Use UPnP") + fontPointSize: JamiTheme.settingsFontSize - Layout.minimumWidth: 40 - Layout.preferredWidth: 40 - Layout.maximumWidth: 40 + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setUseUPnP(checked) } + } - // row 3 - ToggleSwitch { - id: checkBoxTurnEnable + ToggleSwitch { + id: checkBoxTurnEnable - Layout.row: 2 - Layout.column: 0 + Layout.fillWidth: true - labelText: qsTr("Use TURN") - fontPointSize: 10 + labelText: qsTr("Use TURN") + fontPointSize: JamiTheme.settingsFontSize - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setUseTURN(checked) - } + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setUseTURN(checked) } + } - // row 4 - Label { - Layout.row: 3 - Layout.column: 0 - - Layout.minimumWidth: 124 - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("TURN Address") + RowLayout { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("TURN Address") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditTurnAddress + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - Layout.row: 3 - Layout.column: 2 - - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 - - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft @@ -922,37 +798,30 @@ ColumnLayout { ClientWrapper.settingsAdaptor.setTURNAddress(text) } } + } - //row 5 - Label { - Layout.row: 4 - Layout.column: 0 - - Layout.minimumWidth: 124 - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("TURN Username") + RowLayout { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("TURN Username") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditTurnUsername - Layout.row: 4 - Layout.column: 2 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 - - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft @@ -962,38 +831,30 @@ ColumnLayout { ClientWrapper.settingsAdaptor.setTURNUsername(text) } } + } - //row 6 - Label { - Layout.row: 5 - Layout.column: 0 - - Layout.minimumWidth: 124 - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 - - text: qsTr("TURN Password") - - font.pointSize: 10 - font.kerning: true + RowLayout { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + eText: qsTr("TURN Password") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditTurnPassword layer.mipmap: false - Layout.row: 5 - Layout.column: 2 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 - - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft @@ -1004,38 +865,52 @@ ColumnLayout { ClientWrapper.settingsAdaptor.setTURNPassword(text) } } + } - // row 7 - ToggleSwitch { - id: checkBoxSTUNEnable - Layout.row: 6 - Layout.column: 0 + ToggleSwitch { + id: checkBoxSTUNEnable + + Layout.fillWidth: true - labelText: qsTr("Use STUN") - fontPointSize: 10 + labelText: qsTr("Use STUN") + fontPointSize: JamiTheme.settingsFontSize - onSwitchToggled: { - ClientWrapper.settingsAdaptor.setUseSTUN(checked) - lineEditSTUNAddress.enabled = checked - } + onSwitchToggled: { + ClientWrapper.settingsAdaptor.setUseSTUN(checked) + lineEditSTUNAddress.enabled = checked + } + } + + RowLayout { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + ElidedTextLabel { + id: lblEditSTUNAddress + + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + eText: qsTr("STUN Address") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } InfoLineEdit { id: lineEditSTUNAddress - Layout.row: 6 - Layout.column: 2 + fieldLayoutWidth: preferredColumnWidth + fieldLayoutHeight: JamiTheme.preferredFieldHeight - fieldLayoutWidth: 300 - fieldLayoutHeight: 29 - - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true placeholderText: qsTr("STUN Address") - horizontalAlignment: Text.AlignLeft + horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter onEditingFinished: { @@ -1046,53 +921,33 @@ ColumnLayout { } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true Label { Layout.fillWidth: true - Layout.topMargin: 10 - - Layout.minimumHeight: 27 - Layout.preferredHeight: 27 - Layout.maximumHeight: 27 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight text: qsTr("Media") - font.pointSize: 13 + font.pointSize: JamiTheme.headerFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 - } - ColumnLayout { - spacing: 6 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize ToggleSwitch { id: videoCheckBox - Layout.leftMargin: 20 - labelText: qsTr("Enable Video") - fontPointSize: 10 + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { ClientWrapper.settingsAdaptor.setVideoState(checked) @@ -1100,66 +955,46 @@ ColumnLayout { } RowLayout { - spacing: 6 Layout.fillWidth: true - Layout.leftMargin: 20 + Layout.fillHeight: true ColumnLayout { - spacing: 6 - //Layout.fillWidth: true - Layout.maximumWidth: 348 + Layout.fillWidth: true + Layout.fillHeight: true RowLayout { - spacing: 6 Layout.fillWidth: true + Layout.fillHeight: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 30 - - Label { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Video Codecs") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillHeight: true - - Layout.minimumWidth: 20 - Layout.preferredWidth: 20 - Layout.maximumWidth: 20 + maxWidth: preferredColumnWidth - 50 + eText: qsTr("Video Codecs") + fontSize: JamiTheme.settingsFontSize } HoverableRadiusButton { id: videoDownPushButton - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 buttonImageHeight: height buttonImageWidth: height radius: height / 2 - scale: 1 - - font.pointSize: 9 - font.kerning: true icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg" - icon.width: 32 - icon.height: 32 + icon.width: 24 + icon.height: 24 onClicked: { decreaseVideoCodecPriority() @@ -1169,24 +1004,20 @@ ColumnLayout { HoverableRadiusButton { id: videoUpPushButton - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 buttonImageHeight: height buttonImageWidth: height radius: height / 2 - font.pointSize: 9 - font.kerning: true - icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg" - icon.width: 32 - icon.height: 32 + icon.width: 24 + icon.height: 24 onClicked: { increaseVideoCodecPriority() @@ -1197,10 +1028,9 @@ ColumnLayout { ListViewJami { id: videoListWidget - Layout.minimumWidth: 348 - Layout.preferredWidth: 348 - Layout.maximumWidth: 348 - + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth Layout.minimumHeight: 192 Layout.preferredHeight: 192 Layout.maximumHeight: 192 @@ -1230,59 +1060,40 @@ ColumnLayout { } ColumnLayout { - spacing: 6 - Layout.maximumWidth: 348 + Layout.fillWidth: true RowLayout { - spacing: 6 Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 30 - - Label { + ElidedTextLabel { Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Audio Codecs") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillHeight: true - - Layout.minimumWidth: 20 - Layout.preferredWidth: 20 - Layout.maximumWidth: 20 + maxWidth: preferredColumnWidth - 50 + eText: qsTr("Audio Codecs") + fontSize: JamiTheme.settingsFontSize } HoverableRadiusButton { id: audioDownPushButton - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 radius: height / 2 buttonImageHeight: height buttonImageWidth: height - font.pointSize: 9 - font.kerning: true - icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg" - icon.width: 32 - icon.height: 32 + icon.width: 24 + icon.height: 24 onClicked: { decreaseAudioCodecPriority() @@ -1292,25 +1103,20 @@ ColumnLayout { HoverableRadiusButton { id: audioUpPushButton - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 + radius: height / 2 buttonImageHeight: height buttonImageWidth: height - radius: height / 2 - - font.pointSize: 9 - font.kerning: true - icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg" - icon.width: 32 - icon.height: 32 + icon.width: 24 + icon.height: 24 onClicked: { increaseAudioCodecPriority() @@ -1321,10 +1127,9 @@ ColumnLayout { ListViewJami { id: audioListWidget - Layout.minimumWidth: 348 - Layout.preferredWidth: 348 - Layout.maximumWidth: 348 - + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth Layout.minimumHeight: 192 Layout.preferredHeight: 192 Layout.maximumHeight: 192 @@ -1359,12 +1164,4 @@ ColumnLayout { } } } - - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 48 - Layout.preferredHeight: 48 - Layout.maximumHeight: 48 - } } diff --git a/src/settingsview/components/AvSettingPage.qml b/src/settingsview/components/AvSettingPage.qml index 52d3e05ef..288d9a9c1 100644 --- a/src/settingsview/components/AvSettingPage.qml +++ b/src/settingsview/components/AvSettingPage.qml @@ -27,7 +27,7 @@ import net.jami.Models 1.0 import "../../commoncomponents" Rectangle { - id: avSettingPage + id: avSettingsRect AudioInputDeviceModel{ id: audioInputDeviceModel @@ -209,6 +209,7 @@ Rectangle { try{ ClientWrapper.settingsAdaptor.set_Video_Settings_Rate_And_Resolution(ClientWrapper.avmodel.getCurrentVideoCaptureDevice(),rate,resolution) + updatePreviewRatio(resolution) } catch(error){console.warn(error.message)} } @@ -216,6 +217,21 @@ Rectangle { populateVideoSettings() } + function updatePreviewRatio(resolution){ + var res = resolution.split("x") + var ratio = res[1] / res[0] + if (ratio) { + aspectRatio = ratio + } else { + console.error("Could not scale recording video preview") + } + } + + property int preferredColumnWidth: avSettingsScrollView.width / 2 - 50 + property int preferredSettingsWidth: avSettingsScrollView.width - 100 + + property real aspectRatio: 0.75 + property bool previewAvailable: false signal backArrowClicked @@ -236,158 +252,130 @@ Rectangle { } Layout.fillHeight: true - Layout.fillWidth: true + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView + anchors.centerIn: parent - ScrollView{ - anchors.fill: parent - clip: true + ColumnLayout { + anchors.fill: avSettingsRect RowLayout { - width: avSettingPage.width - height: avSettingPage.height - - spacing: 0 - Item { - Layout.fillHeight: true - Layout.maximumWidth: 48 - Layout.preferredWidth: 48 - Layout.minimumWidth: 48 + id: avSettingsTitle + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: JamiTheme.preferredMarginSize + Layout.fillWidth: true + Layout.maximumHeight: 64 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 + + HoverableButton { + id: backToSettingsMenuButton + + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.preferredWidth: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.rightMargin: JamiTheme.preferredMarginSize + + radius: 30 + source: "qrc:/images/icons/ic_arrow_back_24px.svg" + backgroundColor: "white" + onExitColor: "white" + + visible: mainViewWindow.sidePanelHidden + + onClicked: { + backArrowClicked() + } } - ColumnLayout { - spacing: 7 - - Layout.fillHeight: true - Layout.maximumWidth: 580 - Layout.preferredWidth: 580 - Layout.minimumWidth: 580 - - Item { - Layout.fillWidth: true - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 - } + Label { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - RowLayout { + text: qsTr("Audio / Video") + font.pointSize: JamiTheme.titleFontSize + font.kerning: true - Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter - Layout.leftMargin: 16 - Layout.fillWidth: true - Layout.maximumHeight: 64 - Layout.minimumHeight: 64 - Layout.preferredHeight: 64 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } - HoverableButton { + } - Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft - Layout.preferredWidth: 30 - Layout.preferredHeight: 30 - radius: 30 - source: "qrc:/images/icons/ic_arrow_back_24px.svg" - backgroundColor: "white" - onExitColor: "white" + ScrollView { + id: avSettingsScrollView + property ScrollBar vScrollBar: ScrollBar.vertical - visible: mainViewWindow.sidePanelHidden + Layout.fillHeight: true + Layout.fillWidth: true - onClicked: { - backArrowClicked() - } - } + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + width: avSettingsRect.width + height: avSettingsRect.height - avSettingsTitle.height - Label { - Layout.fillWidth: true - Layout.minimumHeight: 25 - Layout.preferredHeight: 25 - Layout.maximumHeight: 25 + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + ScrollBar.vertical.policy: ScrollBar.AsNeeded - text: qsTr("Audio / Video") - font.pointSize: 15 - font.kerning: true + clip: true - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - } + ColumnLayout { + Layout.fillHeight: true + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter - Item { - Layout.fillWidth: true - Layout.minimumHeight: 24 - Layout.preferredHeight: 24 - Layout.maximumHeight: 24 - } + spacing: 24 + // Audio ColumnLayout { - spacing: 0 + spacing: 8 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Label { + ElidedTextLabel { Layout.fillWidth: true - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 - - text: qsTr("Audio") - font.pointSize: 13 - font.kerning: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + eText: qsTr("Audio") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredColumnWidth } ColumnLayout { - spacing: 7 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize RowLayout { - spacing: 7 - Layout.leftMargin: 20 Layout.fillWidth: true - Layout.maximumHeight: 30 - - Label { - Layout.maximumWidth: 77 - Layout.preferredWidth: 77 - Layout.minimumWidth: 77 + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Microphone") - font.pointSize: 11 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Microphone") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } SettingParaCombobox { id: inputComboBox - Layout.maximumWidth: 360 - Layout.preferredWidth: 360 - Layout.minimumWidth: 360 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true model: audioInputDeviceModel @@ -404,67 +392,45 @@ Rectangle { LevelMeter { id: audioInputMeter - Layout.leftMargin: 20 - - Layout.fillWidth: true - - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + Layout.minimumWidth: preferredSettingsWidth + Layout.preferredWidth: preferredSettingsWidth + Layout.maximumWidth: preferredSettingsWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight indeterminate: false from: 0 to: 100 } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 5 - Layout.preferredHeight: 5 - Layout.maximumHeight: 5 - } - RowLayout { - spacing: 7 - Layout.leftMargin: 20 Layout.fillWidth: true - Layout.maximumHeight: 30 - - Label { - Layout.maximumWidth: 95 - Layout.preferredWidth: 95 - Layout.minimumWidth: 95 + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Output Device") - font.pointSize: 11 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Output Device") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } SettingParaCombobox { id: outputComboBox - Layout.maximumWidth: 360 - Layout.preferredWidth: 360 - Layout.minimumWidth: 360 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true model: audioOutputDeviceModel @@ -478,45 +444,33 @@ Rectangle { } RowLayout { - spacing: 7 - Layout.leftMargin: 20 Layout.fillWidth: true - Layout.maximumHeight: 30 + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Label { - Layout.maximumWidth: 77 - Layout.preferredWidth: 77 - Layout.minimumWidth: 77 + ElidedTextLabel { - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Ringtone Device") - font.pointSize: 11 - font.kerning: true + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Ringtone Device") + font.pointSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } SettingParaCombobox { id: ringtoneDeviceComboBox - Layout.maximumWidth: 360 - Layout.preferredWidth: 360 - Layout.minimumWidth: 360 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true model: audioOutputDeviceModel @@ -532,45 +486,31 @@ Rectangle { RowLayout { id: audioManagerRowLayout - spacing: 7 - Layout.leftMargin: 20 Layout.fillWidth: true - Layout.maximumHeight: 30 - - Label { - Layout.maximumWidth: 77 - Layout.preferredWidth: 77 - Layout.minimumWidth: 77 + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight text: qsTr("Audio Manager") - font.pointSize: 11 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - Layout.fillHeight: true + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } SettingParaCombobox { id: audioManagerComboBox - Layout.maximumWidth: 360 - Layout.preferredWidth: 360 - Layout.minimumWidth: 360 + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true model: audioManagerListModel @@ -585,84 +525,54 @@ Rectangle { } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - ColumnLayout { - spacing: 7 + spacing: 8 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Label { + ElidedTextLabel { Layout.fillWidth: true - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - text: qsTr("Video") - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + eText: qsTr("Video") + fontSize: JamiTheme.headerFontSize + maxWidth: preferredSettingsWidth } ColumnLayout { - spacing: 6 + Layout.leftMargin: 16 + RowLayout { - spacing: 7 Layout.fillWidth: true - Layout.leftMargin: 20 - Layout.maximumHeight: 30 + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Label { + ElidedTextLabel { id: labelVideoDevice - Layout.maximumWidth: 44 - Layout.preferredWidth: 44 - Layout.minimumWidth: 44 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Device") - font.pointSize: 11 - font.kerning: true + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + eText: qsTr("Device") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } SettingParaCombobox { id: deviceBox - Layout.maximumWidth: 360 - Layout.preferredWidth: 360 - Layout.minimumWidth: 360 + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true model: videoInputDeviceModel @@ -676,47 +586,33 @@ Rectangle { } RowLayout { - spacing: 7 Layout.fillWidth: true - Layout.leftMargin: 20 - Layout.maximumHeight: 30 + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Label { + ElidedTextLabel { id: labelVideoResolution - Layout.maximumWidth: 47 - Layout.preferredWidth: 47 - Layout.minimumWidth: 47 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Resolution") - font.pointSize: 11 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillHeight: true Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + eText: qsTr("Resolution") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } SettingParaCombobox { id: resolutionBox - Layout.maximumWidth: 360 - Layout.preferredWidth: 360 - Layout.minimumWidth: 360 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true model: videoFormatResolutionModel @@ -729,47 +625,33 @@ Rectangle { } RowLayout { - spacing: 7 Layout.fillWidth: true - Layout.leftMargin: 20 - Layout.maximumHeight: 30 + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Label { + ElidedTextLabel { id: labelVideoFps - Layout.maximumWidth: 47 - Layout.preferredWidth: 47 - Layout.minimumWidth: 47 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Fps") - font.pointSize: 11 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillHeight: true Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + eText: qsTr("Fps") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } SettingParaCombobox { id: fpsBox - Layout.maximumWidth: 360 - Layout.preferredWidth: 360 - Layout.minimumWidth: 360 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 + font.pointSize: JamiTheme.buttonFontSize font.kerning: true model: videoFormatFpsModel @@ -783,53 +665,43 @@ Rectangle { } } - Item { - Layout.fillWidth: true - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - - RowLayout{ + Rectangle { + id: rectBox Layout.alignment: Qt.AlignHCenter - - Layout.preferredWidth: 580 - Layout.minimumWidth: 580 - - Layout.minimumHeight: 224 - Layout.preferredHeight: 224 - Layout.maximumHeight: 224 - - Rectangle { - Layout.alignment: Qt.AlignHCenter - Layout.fillHeight: true - Layout.minimumWidth: 580 - - color: "black" - - PreviewRenderer{ - id: peviewWidget - - visible: previewAvailable - height: parent.height - width: 224 - x: (parent.width - width) /2 - y: 0 + Layout.maximumHeight: width * aspectRatio + Layout.minimumHeight: width * aspectRatio + Layout.preferredHeight: width * aspectRatio + + Layout.minimumWidth: 200 + Layout.maximumWidth: 400 + Layout.preferredWidth: preferredSettingsWidth + color: "white" + radius: 5 + + PreviewRenderer { + id: previewWidget + anchors.fill: rectBox + anchors.centerIn: rectBox + + layer.enabled: true + layer.effect: OpacityMask { + maskSource: rectBox } } } + Label { visible: !previewAvailable Layout.fillWidth: true - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight text: qsTr("Preview unavailable") - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignHCenter @@ -840,24 +712,31 @@ Rectangle { ToggleSwitch { id: hardwareAccelControl - labelText: "Enable hardware acceleration" + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize + + labelText: hwAccelText.elidedText + fontPointSize: JamiTheme.settingsFontSize onSwitchToggled: { slotSetHardwareAccel(checked) } } + TextMetrics { + id: hwAccelText + elide: Text.ElideRight + elideWidth: preferredSettingsWidth - 50 + text: qsTr("Enable hardware acceleration") + } + Item { + Layout.preferredWidth: avSettingsRect.width - 32 + Layout.minimumWidth: avSettingsRect.width - 32 + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32 Layout.fillHeight: true - Layout.fillWidth: true } } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } } - } } diff --git a/src/settingsview/components/BannedItemDelegate.qml b/src/settingsview/components/BannedItemDelegate.qml index 980d539a8..0322bb01f 100644 --- a/src/settingsview/components/BannedItemDelegate.qml +++ b/src/settingsview/components/BannedItemDelegate.qml @@ -57,24 +57,23 @@ ItemDelegate { RowLayout{ anchors.fill: parent - spacing: 7 + spacing: 8 Label{ id: labelContactAvatar Layout.alignment: Qt.AlignVCenter - Layout.leftMargin: 7 - Layout.topMargin: 7 - Layout.bottomMargin: 7 + Layout.leftMargin: 16 + Layout.rightMargin: 16 - Layout.minimumWidth: 48 - Layout.preferredWidth: 48 - Layout.maximumWidth: 48 + Layout.minimumWidth: 32 + Layout.preferredWidth: 32 + Layout.maximumWidth: 32 - Layout.minimumHeight: 48 - Layout.preferredHeight: 48 - Layout.maximumHeight: 48 + Layout.minimumHeight: 32 + Layout.preferredHeight: 32 + Layout.maximumHeight: 32 background: Rectangle{ anchors.fill: parent @@ -100,44 +99,34 @@ ItemDelegate { } } - Item{ - Layout.minimumWidth: 8 - Layout.preferredWidth: 8 - Layout.maximumWidth: 8 - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - ColumnLayout{ Layout.fillWidth: true Layout.fillHeight: true - Layout.topMargin: 7 - Layout.bottomMargin: 7 - Layout.alignment: Qt.AlignVCenter - spacing: 7 - Label{ id: labelContactName Layout.fillWidth: true - Layout.minimumWidth: 0 - Layout.maximumWidth: 16777215 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - font.pointSize: 8 + font.pointSize: JamiTheme.textFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter + text: labelContactNameElidedText.elidedText + } + + TextMetrics { + id: labelContactNameElidedText + elide: Text.ElideRight + elideWidth: deviceItemDelegate.width - 80 text: contactName === "" ? qsTr("name") : contactName } @@ -145,19 +134,24 @@ ItemDelegate { id: labelContactId Layout.fillWidth: true - Layout.minimumWidth: 0 - Layout.maximumWidth: 16777215 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - font.pointSize: 8 + font.pointSize: JamiTheme.textFontSize font.kerning: true horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter + text: labelContactIdElidedText.elidedText + } + + TextMetrics { + id: labelContactIdElidedText + elide: Text.ElideRight + elideWidth: deviceItemDelegate.width - 80 text: contactID === "" ? qsTr("id") : contactID } } @@ -165,24 +159,27 @@ ItemDelegate { HoverableRadiusButton{ id: btnReAddContact - Layout.topMargin: 7 - Layout.bottomMargin: 7 + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + Layout.rightMargin: 8 - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 + Layout.minimumWidth: 32 + Layout.preferredWidth: 32 + Layout.maximumWidth: 32 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: 32 + Layout.preferredHeight: 32 + Layout.maximumHeight: 32 - font.pointSize: 8 - font.kerning: true + buttonImageHeight: height - 8 + buttonImageWidth: width - 8 - buttonImageHeight: height - buttonImageWidth: height + source: "qrc:/images/icons/ic_person_add_black_24dp_2x.png" - source:"qrc:/images/icons/ic_person_add_black_24dp_2x.png" + radius: height / 2 + width: 25 + height: 25 + + backgroundColor: "transparent" ToolTip.visible: isHovering ToolTip.text: qsTr("Add as contact") @@ -191,16 +188,6 @@ ItemDelegate { btnReAddContactClicked() } } - - Item{ - Layout.rightMargin: 7 - - Layout.minimumWidth: 8 - Layout.preferredWidth: 8 - Layout.maximumWidth: 8 - - Layout.minimumHeight: 20 - } } } diff --git a/src/settingsview/components/CurrentAccountSettingsScrollPage.qml b/src/settingsview/components/CurrentAccountSettingsScrollPage.qml index 78358f1d4..d7ba3cafd 100644 --- a/src/settingsview/components/CurrentAccountSettingsScrollPage.qml +++ b/src/settingsview/components/CurrentAccountSettingsScrollPage.qml @@ -45,6 +45,7 @@ Rectangle { property bool registeredIdNeedsSet: false property int refreshVariable : 0 + property int preferredColumnWidth : accountViewRect.width / 2 - 50 signal navigateToMainView signal navigateToNewWizardView @@ -55,6 +56,7 @@ Rectangle { refreshVariable-- } + Connections { id: btnRegisterNameClickConnection target: btnRegisterName @@ -93,12 +95,11 @@ Rectangle { currentRegisteredID.text = "" } - currentRingID.text = ClientWrapper.settingsAdaptor.getCurrentAccount_Profile_Info_Uri() + currentRingIDText.text = ClientWrapper.settingsAdaptor.getCurrentAccount_Profile_Info_Uri() // update device list view updateAndShowDevicesSlot() - bannedContactsListWidget.visible = false bannedContactsLayoutWidget.visible = (bannedListModel.rowCount() > 0) if (advanceSettingsView.visible) { @@ -124,7 +125,7 @@ Rectangle { function setAvatar() { currentAccountAvatar.setAvatarPixmap( ClientWrapper.settingsAdaptor.getAvatarImage_Base64( - currentAccountAvatar.boothWidht), + currentAccountAvatar.boothWidth), ClientWrapper.settingsAdaptor.getIsDefaultAvatar()) } @@ -132,13 +133,13 @@ Rectangle { currentAccountAvatar.stopBooth() } - function toggleBannedContacts(){ + function toggleBannedContacts() { var bannedContactsVisible = bannedContactsListWidget.visible bannedContactsListWidget.visible = !bannedContactsVisible updateAndShowBannedContactsSlot() } - function unban(index){ + function unban(index) { ClientWrapper.settingsAdaptor.unbanContact(index) updateAndShowBannedContactsSlot() } @@ -446,48 +447,30 @@ Rectangle { } Layout.fillHeight: true - Layout.fillWidth: true + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView + anchors.centerIn: parent ColumnLayout { - anchors.fill: parent - spacing: 0 - - Item { - Layout.fillWidth: true - - Layout.maximumHeight: 10 - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - - Layout.alignment: Qt.AlignTop - } + anchors.fill: accountViewRect RowLayout { - spacing: 6 - - Layout.alignment: Qt.AlignTop - + id: accountPageTitle + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: JamiTheme.preferredMarginSize Layout.fillWidth: true - Layout.maximumHeight: 30 - Layout.minimumHeight: 30 - Layout.preferredHeight: accountPageTitle.height - - Item { - Layout.fillHeight: true - - Layout.maximumWidth: 30 - Layout.preferredWidth: 30 - Layout.minimumWidth: 30 - } - + Layout.maximumHeight: 64 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 HoverableButton { + id: backToSettingsMenuButton Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft - Layout.preferredWidth: 30 - Layout.preferredHeight: 30 + Layout.preferredWidth: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.rightMargin: JamiTheme.preferredMarginSize - radius: 30 + radius: 32 source: "qrc:/images/icons/ic_arrow_back_24px.svg" backgroundColor: "white" onExitColor: "white" @@ -499,899 +482,727 @@ Rectangle { } } + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Label { - id: accountPageTitle - - Layout.preferredWidth: 117 - - Layout.maximumHeight: 25 - Layout.preferredHeight: 25 - Layout.minimumHeight: 25 - - text: qsTr("Jami Account") - - font.pointSize: 15 - font.kerning: true + eText: qsTr("Account Settings") + fontSize: JamiTheme.titleFontSize + maxWidth: !backToSettingsMenuButton.visible ? accountViewRect.width - 100 : + accountViewRect.width - backToSettingsMenuButton.width - 100 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - Layout.fillHeight: true } } ScrollView { - id: accoutScrollView + id: accountScrollView - property ScrollBar hScrollBar: ScrollBar.horizontal property ScrollBar vScrollBar: ScrollBar.vertical Layout.fillHeight: true Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - ScrollBar.horizontal.policy: ScrollBar.AsNeeded + width: accountViewRect.width + height: accountViewRect.height - accountPageTitle.height + + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.vertical.policy: ScrollBar.AsNeeded - font.pointSize: 8 - font.kerning: true clip: true + /* + * ScrollView Layout + */ ColumnLayout { - id: accoutnViewLayout + id: accountViewLayout Layout.fillHeight: true - Layout.maximumWidth: 625 + Layout.preferredWidth: accountViewRect.width + Layout.alignment: Qt.AlignHCenter - Item { - Layout.fillHeight: true + spacing: 24 - Layout.maximumWidth: 30 - Layout.preferredWidth: 30 - Layout.minimumWidth: 30 - } - - ColumnLayout { - spacing: 6 - Layout.fillHeight: true - Layout.fillWidth: true + ToggleSwitch { + id: accountEnableCheckBox - Layout.leftMargin: 30 + Layout.topMargin: JamiTheme.preferredMarginSize + Layout.leftMargin: JamiTheme.preferredMarginSize - Item { - Layout.fillHeight: true + labelText: qsTr("Enable") + fontPointSize: JamiTheme.headerFontSize - Layout.maximumWidth: 24 - Layout.preferredWidth: 24 - Layout.minimumWidth: 24 + onSwitchToggled: { + setAccEnableSlot(checked) } + } - ToggleSwitch { - id: accountEnableCheckBox + /* + * Profile + */ + ColumnLayout { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.leftMargin: JamiTheme.preferredMarginSize + spacing: 8 - labelText: qsTr("Enable") - fontPointSize: 11 + Label { + Layout.fillWidth: true - onSwitchToggled: { - setAccEnableSlot(checked) - } - } + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Item { - Layout.fillHeight: true + text: qsTr("Profile") + font.pointSize: JamiTheme.headerFontSize + font.kerning: true - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter } - ColumnLayout { - Layout.fillWidth: true + PhotoboothView { + id: currentAccountAvatar - Label { - Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - Layout.maximumHeight: 21 - Layout.preferredHeight: 21 - Layout.minimumHeight: 21 + boothWidth: Math.min(224, accountViewRect.width - 100) - text: qsTr("Profile") - font.pointSize: 13 - font.kerning: true + Layout.maximumWidth: boothWidth+50 + Layout.preferredWidth: boothWidth+50 + Layout.minimumWidth: boothWidth+50 + Layout.maximumHeight: boothWidth+50 + Layout.preferredHeight: boothWidth+50 + Layout.minimumHeight: boothWidth+50 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + onImageAcquired: { + ClientWrapper.settingsAdaptor.setCurrAccAvatar(imgBase64) } - Item { - Layout.fillWidth: true - - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 + onImageCleared: { + ClientWrapper.settingsAdaptor.clearCurrentAvatar() + setAvatar() } + } - ColumnLayout { - Layout.fillWidth: true - layoutDirection: Qt.LeftToRight - - spacing: 6 - - PhotoboothView { - id: currentAccountAvatar - - Layout.alignment: Qt.AlignHCenter - - Layout.maximumWidth: 261 - Layout.preferredWidth: 261 - Layout.minimumWidth: 261 - Layout.maximumHeight: 261 - Layout.preferredHeight: 261 - Layout.minimumHeight: 261 - - Layout.leftMargin: 20 - - onImageAcquired: { - ClientWrapper.settingsAdaptor.setCurrAccAvatar(imgBase64) - } - - onImageCleared: { - ClientWrapper.settingsAdaptor.clearCurrentAvatar() - setAvatar() - } - } - - InfoLineEdit { - id: displayNameLineEdit + InfoLineEdit { + id: displayNameLineEdit - fieldLayoutWidth: 261 + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.leftMargin: 20 + Layout.alignment: Qt.AlignHCenter - font.pointSize: 10 - font.kerning: true + font.pointSize: JamiTheme.textFontSize + font.kerning: true - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter - onEditingFinished: { - ClientWrapper.accountAdaptor.setCurrAccDisplayName( - displayNameLineEdit.text) - } - } + onEditingFinished: { + ClientWrapper.accountAdaptor.setCurrAccDisplayName( + displayNameLineEdit.text) } } + } - Item { - Layout.fillHeight: true + /* + * Identity + */ + ColumnLayout { + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.leftMargin: JamiTheme.preferredMarginSize + spacing: 8 + + ElidedTextLabel { + Layout.fillWidth: true - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + + eText: qsTr("Identity") + maxWidth: accountViewRect.width - 72 + fontSize: JamiTheme.headerFontSize } - ColumnLayout { + RowLayout { + spacing: 8 Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.leftMargin: JamiTheme.preferredMarginSize Label { + id: idLabel Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: 21 - Layout.preferredHeight: 21 - Layout.minimumHeight: 21 - - text: qsTr("Identity") - font.pointSize: 13 + text: qsTr("Id") + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } - Item { - Layout.fillHeight: true - - Layout.maximumWidth: 10 - Layout.preferredWidth: 10 - Layout.minimumWidth: 10 - } + TextField { + id: currentRingID - ColumnLayout { - spacing: 7 + property var backgroundColor: "transparent" + property var borderColor: "transparent" Layout.fillWidth: true + Layout.fillHeight: true - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.maximumHeight: 30 - - Layout.leftMargin: 20 - - Layout.maximumWidth: 625 - - Label { - Layout.maximumWidth: 13 - Layout.preferredWidth: 13 - Layout.minimumWidth: 13 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Id") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - TextField { - id: currentRingID - - property var backgroundColor: "transparent" - property var borderColor: "transparent" + font.pointSize: JamiTheme.textFontSize + font.kerning: true + font.bold: true - Layout.fillWidth: true + readOnly: true + selectByMouse: true - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + text: { currentRingIDText.elidedText } - font.pointSize: 10 - font.kerning: true - font.bold: true + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter - readOnly: true - selectByMouse: true + background: Rectangle { + anchors.fill: parent + radius: 0 + border.color: currentRingID.borderColor + border.width: 0 + color: currentRingID.backgroundColor + } - text: { refreshVariable - return ClientWrapper.settingsAdaptor.getCurrentAccount_Profile_Info_Uri()} + TextMetrics { + id: currentRingIDText - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + elideWidth: accountViewRect.width - idLabel.width -JamiTheme.preferredMarginSize*3 - background: Rectangle { - anchors.fill: parent - radius: 0 - border.color: currentRingID.borderColor - border.width: 0 - color: currentRingID.backgroundColor - } + text: { refreshVariable + return ClientWrapper.settingsAdaptor.getCurrentAccount_Profile_Info_Uri() } } + } + } - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.maximumHeight: 32 - - Layout.leftMargin: 20 - - layoutDirection: Qt.LeftToRight - - Label { - id: lblRegisteredName + RowLayout { + spacing: 8 + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.leftMargin: JamiTheme.preferredMarginSize - Layout.maximumWidth: 127 - Layout.preferredWidth: 127 - Layout.minimumWidth: 127 + ElidedTextLabel { + id: lblRegisteredName + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 32 - Layout.preferredHeight: 32 - Layout.maximumHeight: 32 + eText: qsTr("Registered name") + fontSize: JamiTheme.settingsFontSize + maxWidth: 160 + } - text: qsTr("Registered name") + TextField { + id: currentRegisteredID + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + placeholderText: { refreshVariable + var result = registeredIdNeedsSet ? qsTr("Type here to register a username") : "" + return result} + + text: { + refreshVariable + if (!registeredIdNeedsSet){ + return ClientWrapper.settingsAdaptor.get_CurrentAccountInfo_RegisteredName() + } else { + return "" + } + } + selectByMouse: true + readOnly: { refreshVariable + return !registeredIdNeedsSet} - font.pointSize: 10 - font.kerning: true + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true + font.bold: { refreshVariable + return !registeredIdNeedsSet} - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.maximumHeight: 30 - Layout.alignment: Qt.AlignVCenter - - TextField { - id: currentRegisteredID - - Layout.maximumWidth: 300 - Layout.preferredWidth: 300 - Layout.minimumWidth: 300 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - placeholderText: { refreshVariable - var result = registeredIdNeedsSet ? qsTr("Type here to register a username") : "" - return result} - - text: { - refreshVariable - if (!registeredIdNeedsSet){ - return ClientWrapper.settingsAdaptor.get_CurrentAccountInfo_RegisteredName() - } else { - return "" - } - } - selectByMouse: true - readOnly: { refreshVariable - return !registeredIdNeedsSet} - - font.pointSize: 10 - font.kerning: true - font.bold: { refreshVariable - return !registeredIdNeedsSet} - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - background: Rectangle { - anchors.fill: parent - radius: {refreshVariable - var result = registeredIdNeedsSet ? height / 2 : 0 - return result} - border.color: "transparent" - border.width: {refreshVariable - var result = registeredIdNeedsSet ? 2 : 0 - return result} - color: {refreshVariable - var result = registeredIdNeedsSet ? Qt.rgba( - 240 / 256, 240 / 256, - 240 / 256, - 1.0) : "transparent" - return result} - } - - onTextEdited: { - verifyRegisteredNameSlot() - } - - onEditingFinished: { - verifyRegisteredNameSlot() - } - } - - LookupStatusLabel { - id: lookupStatusLabel - - visible:{refreshVariable - var result = registeredIdNeedsSet - && (regNameUi - !== CurrentAccountSettingsScrollPage.BLANK) - return result} - - MouseArea { - id: lookupStatusLabelArea - anchors.fill: parent - property bool isHovering: false - - onEntered: isHovering = true - onExited: isHovering = false - - hoverEnabled: true - } - - ToolTip.visible: lookupStatusLabelArea.isHovering - ToolTip.text: { - switch (regNameUi) { - case CurrentAccountSettingsScrollPage.BLANK: - return qsTr("") - case CurrentAccountSettingsScrollPage.INVALIDFORM: - return qsTr("A registered name should not have any spaces and must be at least three letters long") - case CurrentAccountSettingsScrollPage.TAKEN: - return qsTr("This name is already taken") - case CurrentAccountSettingsScrollPage.FREE: - return qsTr("Register this name") - case CurrentAccountSettingsScrollPage.SEARCHING: - return qsTr("") - default: - return qsTr("") - } - } - - lookupStatusState: { - switch (regNameUi) { - case CurrentAccountSettingsScrollPage.BLANK: - return "Blank" - case CurrentAccountSettingsScrollPage.INVALIDFORM: - return "Invalid" - case CurrentAccountSettingsScrollPage.TAKEN: - return "Taken" - case CurrentAccountSettingsScrollPage.FREE: - return "Free" - case CurrentAccountSettingsScrollPage.SEARCHING: - return "Searching" - default: - return "Blank" - } - } - } - - HoverableRadiusButton { - id: btnRegisterName - - visible: {refreshVariable - var result = registeredIdNeedsSet - && (regNameUi - === CurrentAccountSettingsScrollPage.FREE) - return result} - - Layout.maximumWidth: 80 - Layout.preferredWidth: 80 - Layout.minimumWidth: 80 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - text: qsTr("Register") - font.pointSize: 10 - font.kerning: true - - radius: height / 2 - } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - } + background: Rectangle { + anchors.fill: parent + radius: {refreshVariable + var result = registeredIdNeedsSet ? height / 2 : 0 + return result} + border.color: "transparent" + border.width: {refreshVariable + var result = registeredIdNeedsSet ? 2 : 0 + return result} + color: {refreshVariable + var result = registeredIdNeedsSet ? Qt.rgba( + 240 / 256, 240 / 256, + 240 / 256, + 1.0) : "transparent" + return result} } - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.maximumHeight: 30 + onTextEdited: { + verifyRegisteredNameSlot() + } - Layout.leftMargin: 20 + onEditingFinished: { + verifyRegisteredNameSlot() + } + } + } - HoverableButtonTextItem { - id: passwdPushButton + RowLayout { + Layout.fillWidth: true + Layout.alignment: Qt.AlignRight + visible:{refreshVariable + var result = registeredIdNeedsSet + && (regNameUi + !== CurrentAccountSettingsScrollPage.BLANK) + return result} + + LookupStatusLabel { + id: lookupStatusLabel + Layout.fillWidth: true - visible: ClientWrapper.settingsAdaptor.getAccountConfig_Manageruri() === "" - Layout.maximumWidth: 261 - Layout.preferredWidth: 261 - Layout.minimumWidth: 261 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - text: ClientWrapper.accountAdaptor.hasPassword() ? qsTr("Change Password") : qsTr("Set Password") + MouseArea { + id: lookupStatusLabelArea + anchors.fill: parent + property bool isHovering: false - font.pointSize: 10 - font.kerning: true + onEntered: isHovering = true + onExited: isHovering = false - radius: height / 2 + hoverEnabled: true + } - onClicked: { - passwordClicked() - } + ToolTip.visible: lookupStatusLabelArea.isHovering + ToolTip.text: { + switch (regNameUi) { + case CurrentAccountSettingsScrollPage.BLANK: + return qsTr("") + case CurrentAccountSettingsScrollPage.INVALIDFORM: + return qsTr("A registered name should not have any spaces and must be at least three letters long") + case CurrentAccountSettingsScrollPage.TAKEN: + return qsTr("This name is already taken") + case CurrentAccountSettingsScrollPage.FREE: + return qsTr("Register this name") + case CurrentAccountSettingsScrollPage.SEARCHING: + return qsTr("") + default: + return qsTr("") } + } - Item { - Layout.fillHeight: true - Layout.fillWidth: true + lookupStatusState: { + switch (regNameUi) { + case CurrentAccountSettingsScrollPage.BLANK: + return "Blank" + case CurrentAccountSettingsScrollPage.INVALIDFORM: + return "Invalid" + case CurrentAccountSettingsScrollPage.TAKEN: + return "Taken" + case CurrentAccountSettingsScrollPage.FREE: + return "Free" + case CurrentAccountSettingsScrollPage.SEARCHING: + return "Searching" + default: + return "Blank" } } + } - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.maximumHeight: 30 - - Layout.leftMargin: 20 + HoverableButtonTextItem { + id: btnRegisterName - HoverableButtonTextItem { - id: btnExportAccount + visible: {refreshVariable + var result = registeredIdNeedsSet + && (regNameUi + === CurrentAccountSettingsScrollPage.FREE) + return result} - visible: ClientWrapper.settingsAdaptor.getAccountConfig_Manageruri() === "" + Layout.minimumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.maximumWidth: preferredColumnWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumWidth: 261 - Layout.preferredWidth: 261 - Layout.minimumWidth: 261 + text: qsTr("Register") + font.pointSize: JamiTheme.buttonFontSize + font.kerning: true - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + radius: height / 2 + } + } + } - text: qsTr("Export Account") - font.pointSize: 10 - font.kerning: true + /* + * Buttons Pwd, Export, Delete + */ + ColumnLayout { + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.leftMargin: JamiTheme.preferredMarginSize + spacing: 8 - radius: height / 2 + HoverableButtonTextItem { + id: passwdPushButton - onClicked: { - exportAccountSlot() - } - } + visible: ClientWrapper.settingsAdaptor.getAccountConfig_Manageruri() === "" - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - } + Layout.alignment: Qt.AlignHCenter + Layout.minimumWidth: JamiTheme.preferredButtonWidth + Layout.preferredWidth: JamiTheme.preferredButtonWidth + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - RowLayout { - spacing: 6 - Layout.fillWidth: true - Layout.maximumHeight: 30 + text: ClientWrapper.accountAdaptor.hasPassword() ? qsTr("Change Password") : qsTr("Set Password") - Layout.leftMargin: 20 + font.pointSize: JamiTheme.textFontSize + font.kerning: true - HoverableButtonTextItem { - id: btnDeletAccount + radius: height / 2 - backgroundColor: "red" - onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7) - onDisabledBackgroundColor: Qt.rgba( - 255 / 256, - 0, 0, 0.8) - onPressColor: backgroundColor - textColor: "white" + onClicked: { + passwordClicked() + } + } - Layout.maximumWidth: 261 - Layout.preferredWidth: 261 - Layout.minimumWidth: 261 + HoverableButtonTextItem { + id: btnExportAccount - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + visible: ClientWrapper.settingsAdaptor.getAccountConfig_Manageruri() === "" - text: qsTr("Delete Account") - font.pointSize: 10 - font.kerning: true + Layout.alignment: Qt.AlignHCenter + Layout.minimumWidth: JamiTheme.preferredButtonWidth + Layout.preferredWidth: JamiTheme.preferredButtonWidth + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - radius: height / 2 + text: qsTr("Export Account") + font.pointSize: JamiTheme.textFontSize + font.kerning: true - onClicked: { - delAccountSlot() - } - } + radius: height / 2 - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - } + onClicked: { + exportAccountSlot() } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 + HoverableButtonTextItem { + id: btnDeletAccount + + backgroundColor: "red" + onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7) + onDisabledBackgroundColor: Qt.rgba( + 255 / 256, + 0, 0, 0.8) + onPressColor: backgroundColor + textColor: "white" + + Layout.alignment: Qt.AlignHCenter + Layout.minimumWidth: JamiTheme.preferredButtonWidth + Layout.preferredWidth: JamiTheme.preferredButtonWidth + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + text: qsTr("Delete Account") + font.pointSize: JamiTheme.textFontSize + font.kerning: true + + radius: height / 2 + + onClicked: { + delAccountSlot() + } } + } - ColumnLayout { - Layout.fillWidth: true - - Label { - Layout.fillWidth: true - - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 + /* + Linked devices + */ + ColumnLayout { + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - text: qsTr("Linked Device") - font.pointSize: 13 - font.kerning: true + Label { + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + text: qsTr("Linked Devices") - Item { - Layout.fillHeight: true + font.pointSize: JamiTheme.headerFontSize + font.kerning: true + } - Layout.maximumWidth: 10 - Layout.preferredWidth: 10 - Layout.minimumWidth: 10 - } + ColumnLayout { + id: linkedDevicesLayout + Layout.fillWidth: true - ColumnLayout { - spacing: 7 + ListViewJami { + id: settingsListView Layout.fillWidth: true - ListViewJami { - id: settingsListView - - Layout.leftMargin: 20 - - Layout.fillWidth: true - - Layout.minimumWidth: 580 - Layout.preferredWidth: 605 + Layout.minimumHeight: 160 + Layout.preferredHeight: 160 + Layout.maximumHeight: 160 - Layout.minimumHeight: 164 - Layout.preferredHeight: 164 - Layout.maximumHeight: 164 + model: deviceItemListModel - model: deviceItemListModel + delegate: DeviceItemDelegate{ + id: settingsListDelegate - delegate: DeviceItemDelegate{ - id: settingsListDelegate + width: settingsListView.width + height: 72 - width: settingsListView.width - height: 85 + deviceName : DeviceName + deviceId: DeviceID + isCurrent: IsCurrent - deviceName : DeviceName - deviceId: DeviceID - isCurrent: IsCurrent - - onClicked: { - settingsListView.currentIndex = index - } + onClicked: { + settingsListView.currentIndex = index + } - onBtnRemoveDeviceClicked:{ - removeDeviceSlot(index) - } + onBtnRemoveDeviceClicked:{ + removeDeviceSlot(index) } } + } - HoverableRadiusButton { - id: linkDevPushButton - - visible: ClientWrapper.settingsAdaptor.getAccountConfig_Manageruri() === "" + HoverableButtonTextItem { + id: linkDevPushButton - Layout.leftMargin: 20 + visible: ClientWrapper.settingsAdaptor.getAccountConfig_Manageruri() === "" - Layout.fillWidth: true + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.preferredWidth: JamiTheme.preferredButtonWidth + Layout.minimumWidth: JamiTheme.preferredButtonWidth - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignHCenter - radius: height / 2 + radius: height / 2 - text: qsTr("+Link Another Device") - font.pointSize: 10 - font.kerning: true + text: qsTr("+ Link Another Device") + font.pointSize: JamiTheme.textFontSize + font.kerning: true - onClicked: { - showLinkDevSlot() - } + onClicked: { + showLinkDevSlot() } } } + } - Item { - Layout.fillWidth: true + /* + * Banned contacts + */ + ColumnLayout { + id: bannedContactsLayoutWidget - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize + Layout.alignment: Qt.AlignHCenter - // banned list view - ColumnLayout { - id: bannedContactsLayoutWidget + spacing: 8 + RowLayout { Layout.fillWidth: true - spacing: 6 - - RowLayout { - Layout.leftMargin: 9 - Layout.rightMargin: 8 - Layout.topMargin: 1 - - Layout.fillWidth: true - Layout.maximumHeight: 30 - - Label { - Layout.preferredWidth: 164 - Layout.minimumWidth: 164 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + ElidedTextLabel { - text: qsTr("Banned Contact") - font.pointSize: 13 - font.kerning: true + id: lblBannedContacts - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillHeight: true - - Layout.maximumWidth: 10 - Layout.preferredWidth: 10 - Layout.minimumWidth: 10 - } - - HoverableRadiusButton { - id: bannedContactsBtn + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.maximumWidth: 30 - Layout.preferredWidth: 30 - Layout.minimumWidth: 30 + eText: qsTr("Banned Contacts") + fontSize: JamiTheme.headerFontSize + maxWidth: accountViewRect.width - bannedContactsBtn.width -JamiTheme.preferredMarginSize*4 + } - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + HoverableButtonTextItem { + id: bannedContactsBtn - buttonImageHeight: height - buttonImageWidth: height + Layout.alignment: Qt.AlignRight - radius: height / 2 + Layout.maximumWidth: JamiTheme.preferredFieldHeight + Layout.preferredWidth: JamiTheme.preferredFieldHeight + Layout.minimumWidth: JamiTheme.preferredFieldHeight - icon.source: bannedContactsListWidget.visible? "qrc:/images/icons/round-arrow_drop_up-24px.svg" : "qrc:/images/icons/round-arrow_drop_down-24px.svg" - icon.height: 32 - icon.width: 32 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - onClicked: { - toggleBannedContacts() - } - } + radius: height / 2 - Item { - Layout.fillHeight: true - Layout.fillWidth: true + source: bannedContactsListWidget.visible? "qrc:/images/icons/round-arrow_drop_up-24px.svg" : + "qrc:/images/icons/round-arrow_drop_down-24px.svg" + onClicked: { + toggleBannedContacts() } } + } - ColumnLayout { - id: bannedContactsListWidget - - spacing: 6 - - Layout.leftMargin: 9 - Layout.rightMargin: 8 - Layout.bottomMargin: 9 - Item { - Layout.fillWidth: true - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 - } + ColumnLayout { + id: bannedContactsListWidget - ListViewJami { - id: bannedListWidget + spacing: 8 + visible: false - Layout.leftMargin: 20 - Layout.fillWidth: true + ListViewJami { + id: bannedListWidget - Layout.minimumWidth: 580 + Layout.fillWidth: true - Layout.minimumHeight: 150 - Layout.preferredHeight: 150 - Layout.maximumHeight: 150 + Layout.minimumHeight: 160 + Layout.preferredHeight: 160 + Layout.maximumHeight: 160 - model: bannedListModel + model: bannedListModel - delegate: BannedItemDelegate{ - id: bannedListDelegate + delegate: BannedItemDelegate{ + id: bannedListDelegate - width: bannedListWidget.width - height: 74 + width: bannedListWidget.width + height: 74 - contactName : ContactName - contactID: ContactID - contactPicture_base64: ContactPicture + contactName : ContactName + contactID: ContactID + contactPicture_base64: ContactPicture - onClicked: { - bannedListWidget.currentIndex = index - } + onClicked: { + bannedListWidget.currentIndex = index + } - onBtnReAddContactClicked: { - unban(index) - } + onBtnReAddContactClicked: { + unban(index) } } } } + } - Item { - Layout.fillWidth: true + /* + * Advanced Settigs Button + */ - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } + RowLayout { + id: rowAdvancedSettingsBtn + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - RowLayout { - Layout.fillWidth: true + ElidedTextLabel { - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + id: lblAdvancedAccountSettings - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - HoverableRadiusButton { - id: advancedAccountSettingsPButton + eText: qsTr("Advanced Account Settings") - Layout.minimumWidth: 180 + fontSize: JamiTheme.headerFontSize + maxWidth: accountViewRect.width - advancedAccountSettingsPButton.width -JamiTheme.preferredMarginSize*4 + } - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + HoverableButtonTextItem { + id: advancedAccountSettingsPButton - radius: height / 2 + Layout.leftMargin: JamiTheme.preferredMarginSize - text: qsTr("Advanced Account Settings") - font.pointSize: 10 - font.kerning: true + Layout.minimumWidth: JamiTheme.preferredFieldHeight + Layout.preferredWidth: JamiTheme.preferredFieldHeight + Layout.maximumWidth: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - icon.source: { - if (advanceSettingsView.visible) { - return "qrc:/images/icons/round-arrow_drop_up-24px.svg" - } else { - return "qrc:/images/icons/round-arrow_drop_down-24px.svg" - } - } + Layout.alignment: Qt.AlignHCenter - icon.height: 24 - icon.width: 24 + radius: height / 2 - onClicked: { - advanceSettingsView.visible = !advanceSettingsView.visible - if (advanceSettingsView.visible) { - advanceSettingsView.updateAccountInfoDisplayedAdvance() - var mappedCoor = advancedAccountSettingsPButton.mapToItem(accoutnViewLayout,advancedAccountSettingsPButton.x,advancedAccountSettingsPButton.y) - accoutScrollView.vScrollBar.position = mappedCoor.y / accoutnViewLayout.height - } else { - accoutScrollView.vScrollBar.position = 0 - } + source: { + if (advanceSettingsView.visible) { + return "qrc:/images/icons/round-arrow_drop_up-24px.svg" + } else { + return "qrc:/images/icons/round-arrow_drop_down-24px.svg" } } - Item { - Layout.fillWidth: true - Layout.fillHeight: true + onClicked: { + advanceSettingsView.visible = !advanceSettingsView.visible + if (advanceSettingsView.visible) { + advanceSettingsView.updateAccountInfoDisplayedAdvance() + accountScrollView.vScrollBar.position = rowAdvancedSettingsBtn.y / accountViewLayout.height + } else { + accountScrollView.vScrollBar.position = 0 + } } } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 48 - Layout.preferredHeight: 48 - Layout.maximumHeight: 48 + /* + * Advanced Settings + */ + AdvancedSettingsView { + id: advanceSettingsView + Layout.leftMargin: JamiTheme.preferredMarginSize + visible: false } - ColumnLayout { - spacing: 6 + /* + * To keep max width + */ + Item { + Layout.preferredWidth: accountViewRect.width - 32 + Layout.minimumWidth: accountViewRect.width - 32 + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32 Layout.fillHeight: true - Layout.fillWidth: true - - Layout.leftMargin: 30 - - // instantiate advance setting page - AdvancedSettingsView { - id: advanceSettingsView - - Layout.leftMargin: 10 - visible: false - } } } } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } } } diff --git a/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml b/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml index 68de1e149..eb5aaaba6 100644 --- a/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml +++ b/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml @@ -27,10 +27,13 @@ import net.jami.Models 1.0 import "../../commoncomponents" Rectangle { + id: sipAccountViewRect signal navigateToMainView signal navigateToNewWizardView signal backArrowClicked + property int preferredColumnWidth : sipAccountViewRect.width / 2 - 50 + function updateAccountInfoDisplayed() { displaySIPNameLineEdit.text = ClientWrapper.settingsAdaptor.getCurrentAccount_Profile_Info_Alias() usernameSIP.text = ClientWrapper.settingsAdaptor.getAccountConfig_Username() @@ -54,7 +57,7 @@ Rectangle { function setAvatar() { currentSIPAccountAvatar.setAvatarPixmap( ClientWrapper.settingsAdaptor.getAvatarImage_Base64( - currentSIPAccountAvatar.boothWidht), + currentSIPAccountAvatar.boothWidth), ClientWrapper.settingsAdaptor.getIsDefaultAvatar()) } @@ -91,47 +94,30 @@ Rectangle { } Layout.fillHeight: true - Layout.fillWidth: true + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView + anchors.centerIn: parent ColumnLayout { - anchors.fill: parent - spacing: 0 - - Item { - Layout.fillWidth: true - - Layout.maximumHeight: 10 - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - - Layout.alignment: Qt.AlignTop - } + anchors.fill: sipAccountViewRect RowLayout { - spacing: 6 - - Layout.alignment: Qt.AlignTop - + id: sipAccountPageTitle + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: JamiTheme.preferredMarginSize Layout.fillWidth: true - Layout.maximumHeight: 31 - Layout.minimumHeight: 0 - Layout.preferredHeight: accountPageTitleSIP.height - - Item { - Layout.fillHeight: true - - Layout.maximumWidth: 48 - Layout.preferredWidth: 48 - Layout.minimumWidth: 48 - } + Layout.maximumHeight: 64 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 HoverableButton { + id: backToSettingsMenuButton Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft - Layout.preferredWidth: 30 - Layout.preferredHeight: 30 + Layout.preferredWidth: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.rightMargin: JamiTheme.preferredMarginSize - radius: 30 + radius: 32 source: "qrc:/images/icons/ic_arrow_back_24px.svg" backgroundColor: "white" onExitColor: "white" @@ -143,510 +129,376 @@ Rectangle { } } - Label { - id: accountPageTitleSIP - - Layout.preferredWidth: 133 - - Layout.preferredHeight: 31 - Layout.minimumHeight: 25 - - text: qsTr("SIP Account") - - font.pointSize: 15 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + eText: qsTr("Account Settings") + fontSize: JamiTheme.titleFontSize + maxWidth: !backToSettingsMenuButton.visible ? sipAccountViewRect.width - 100 : + sipAccountViewRect.width - backToSettingsMenuButton.width - 100 - Item { - Layout.fillWidth: true - Layout.fillHeight: true } } ScrollView { - id: accountSIPScrollView + id: sipAccountScrollView - property ScrollBar hScrollBar: ScrollBar.horizontal property ScrollBar vScrollBar: ScrollBar.vertical Layout.fillHeight: true Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - ScrollBar.horizontal.policy: ScrollBar.AsNeeded + width: sipAccountViewRect.width + height: sipAccountViewRect.height - sipAccountPageTitle.height + + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.vertical.policy: ScrollBar.AsNeeded - font.pointSize: 8 - font.kerning: true clip: true ColumnLayout { id: accountSIPLayout Layout.fillHeight: true - Layout.maximumWidth: 598 + Layout.preferredWidth: sipAccountViewRect.width + Layout.alignment: Qt.AlignHCenter - Item { - Layout.fillHeight: true + spacing: 24 - Layout.maximumWidth: 30 - Layout.preferredWidth: 30 - Layout.minimumWidth: 30 - } + ToggleSwitch { + id: accountSIPEnableCheckBox - ColumnLayout { - spacing: 6 - Layout.fillHeight: true - Layout.fillWidth: true - - Layout.leftMargin: 48 + Layout.topMargin: JamiTheme.preferredMarginSize + Layout.leftMargin: JamiTheme.preferredMarginSize - Item { - Layout.fillHeight: true + labelText: qsTr("Enable") + fontPointSize: JamiTheme.headerFontSize - Layout.maximumWidth: 24 - Layout.preferredWidth: 24 - Layout.minimumWidth: 24 + onSwitchToggled: { + setAccEnableSlot(checked) } + } - ToggleSwitch { - id: accountSIPEnableCheckBox + ColumnLayout { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.leftMargin: JamiTheme.preferredMarginSize + spacing: 8 - labelText: qsTr("Enable") - fontPointSize: 10 + Label { + Layout.fillWidth: true - onSwitchToggled: { - setAccEnableSlot(checked) - } - } + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Item { - Layout.fillHeight: true + text: qsTr("Profile") + font.pointSize: JamiTheme.headerFontSize + font.kerning: true - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter } - ColumnLayout { - Layout.fillWidth: true + PhotoboothView { + id: currentSIPAccountAvatar - Label { - Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - Layout.maximumHeight: 21 - Layout.preferredHeight: 21 - Layout.minimumHeight: 21 + boothWidth: Math.min(224, sipAccountViewRect.width - 100) - text: qsTr("Profile") - font.pointSize: 13 - font.kerning: true + Layout.maximumWidth: boothWidth+50 + Layout.preferredWidth: boothWidth+50 + Layout.minimumWidth: boothWidth+50 + Layout.maximumHeight: boothWidth+50 + Layout.preferredHeight: boothWidth+50 + Layout.minimumHeight: boothWidth+50 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + onImageAcquired: { + ClientWrapper.settingsAdaptor.setCurrAccAvatar(imgBase64) } - Item { - Layout.fillWidth: true - - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 + onImageCleared: { + ClientWrapper.settingsAdaptor.clearCurrentAvatar() + setAvatar() } + } - ColumnLayout { - Layout.fillWidth: true - layoutDirection: Qt.LeftToRight - - spacing: 6 - - PhotoboothView { - id: currentSIPAccountAvatar - - Layout.alignment: Qt.AlignHCenter + InfoLineEdit { + id: displaySIPNameLineEdit - Layout.maximumWidth: 261 - Layout.preferredWidth: 261 - Layout.minimumWidth: 261 - Layout.maximumHeight: 261 - Layout.preferredHeight: 261 - Layout.minimumHeight: 261 + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.leftMargin: 20 + Layout.alignment: Qt.AlignHCenter - onImageAcquired: { - ClientWrapper.settingsAdaptor.setCurrAccAvatar(imgBase64) - } + font.pointSize: JamiTheme.textFontSize + font.kerning: true - onImageCleared: { - ClientWrapper.settingsAdaptor.clearCurrentAvatar() - setAvatar() - } - } + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter - InfoLineEdit { - id: displaySIPNameLineEdit + onEditingFinished: { + ClientWrapper.accountAdaptor.setCurrAccDisplayName( + displaySIPNameLineEdit.text) + } + } + } - fieldLayoutWidth: 261 - Layout.leftMargin: 20 + ColumnLayout { + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.leftMargin: JamiTheme.preferredMarginSize + spacing: 8 - font.pointSize: 10 - font.kerning: true + ElidedTextLabel { + Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - onEditingFinished: { - ClientWrapper.accountAdaptor.setCurrAccDisplayName( - displaySIPNameLineEdit.text) - } - } - } + eText: qsTr("Identity") + maxWidth: sipAccountViewRect.width - 72 + fontSize: JamiTheme.headerFontSize } - Item { - Layout.fillWidth: true - Layout.maximumHeight: 20 - Layout.preferredHeight: 20 - Layout.minimumHeight: 20 - } + GridLayout { + rows: 4 + columns: 2 + flow: GridLayout.LeftToRight + rowSpacing: 8 + columnSpacing: 6 - ColumnLayout { Layout.fillWidth: true - spacing: 6 + Layout.leftMargin: JamiTheme.preferredMarginSize - Label { + // user name + ElidedTextLabel { Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + + eText: qsTr("Username") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } + + InfoLineEdit { + id: usernameSIP - Layout.maximumHeight: 27 - Layout.preferredHeight: 27 - Layout.minimumHeight: 27 + fieldLayoutWidth: preferredColumnWidth - text: qsTr("Identity") - font.pointSize: 13 + font.pointSize: JamiTheme.settingsFontSize // Albert: buttonSize? font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 + onEditingFinished: { + ClientWrapper.settingsAdaptor.setAccountConfig_Username( + usernameSIP.text) + } } - ColumnLayout { + // host name + ElidedTextLabel { Layout.fillWidth: true - spacing: 6 - - GridLayout { - rows: 4 - columns: 2 - flow: GridLayout.LeftToRight - rowSpacing: 14 - columnSpacing: 6 - - Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.leftMargin: 20 - - // user name - Label { - Layout.maximumWidth: 76 - Layout.preferredWidth: 76 - Layout.minimumWidth: 76 - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - text: qsTr("Username") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - InfoLineEdit { - id: usernameSIP - - fieldLayoutWidth: 300 - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - onEditingFinished: { - ClientWrapper.settingsAdaptor.setAccountConfig_Username( - usernameSIP.text) - } - } - - // host name - Label { - Layout.maximumWidth: 76 - Layout.preferredWidth: 76 - Layout.minimumWidth: 76 - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - text: qsTr("Hostname") - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - InfoLineEdit { - id: hostnameSIP - - fieldLayoutWidth: 300 - - font.pointSize: 10 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - onEditingFinished: { - ClientWrapper.settingsAdaptor.setAccountConfig_Hostname( - hostnameSIP.text) - } - } - - // proxy - Label { - Layout.maximumWidth: 76 - Layout.preferredWidth: 76 - Layout.minimumWidth: 76 - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + eText: qsTr("Hostname") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - text: qsTr("Proxy") - font.pointSize: 10 - font.kerning: true + InfoLineEdit { + id: hostnameSIP - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + fieldLayoutWidth: preferredColumnWidth - InfoLineEdit { - id: proxySIP + font.pointSize: JamiTheme.settingsFontSize // Albert: button? + font.kerning: true - fieldLayoutWidth: 300 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter - font.pointSize: 10 - font.kerning: true + onEditingFinished: { + ClientWrapper.settingsAdaptor.setAccountConfig_Hostname( + hostnameSIP.text) + } + } - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + // proxy + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - onEditingFinished: { - ClientWrapper.settingsAdaptor.setAccountConfig_ProxyServer( - proxySIP.text) - } - } + text: qsTr("Proxy") + font.pointSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - // password - Label { - Layout.maximumWidth: 76 - Layout.preferredWidth: 76 - Layout.minimumWidth: 76 + InfoLineEdit { + id: proxySIP - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 + fieldLayoutWidth: preferredColumnWidth - text: qsTr("Password") - font.pointSize: 10 - font.kerning: true + font.pointSize: JamiTheme.settingsFontSize // Albert + font.kerning: true - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter - InfoLineEdit { - id: passSIPlineEdit + onEditingFinished: { + ClientWrapper.settingsAdaptor.setAccountConfig_ProxyServer( + proxySIP.text) + } + } - fieldLayoutWidth: 300 + // password + ElidedTextLabel { + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - font.pointSize: 10 - font.kerning: true + eText: qsTr("Password") + fontSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth + } - echoMode: TextInput.Password - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + InfoLineEdit { + id: passSIPlineEdit - onEditingFinished: { - ClientWrapper.settingsAdaptor.setAccountConfig_Password( - passSIPlineEdit.text) - } - } - } + fieldLayoutWidth: preferredColumnWidth - Item { - Layout.fillWidth: true + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - Layout.maximumHeight: 10 - Layout.preferredHeight: 10 - Layout.minimumHeight: 10 - } + echoMode: TextInput.Password + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter - RowLayout { - Layout.fillWidth: true - Layout.maximumHeight: 30 - Layout.leftMargin: 20 - - HoverableButtonTextItem { - id: btnSIPDeletAccount - - backgroundColor: "red" - onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7) - onDisabledBackgroundColor: Qt.rgba( - 255 / 256, - 0, 0, 0.8) - onPressColor: backgroundColor - textColor: "white" - - Layout.maximumWidth: 261 - Layout.preferredWidth: 261 - Layout.minimumWidth: 261 - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - radius: height / 2 - - text: qsTr("Delete Account") - font.pointSize: 10 - font.kerning: true - - onClicked: { - delAccountSlot() - } - } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + onEditingFinished: { + ClientWrapper.settingsAdaptor.setAccountConfig_Password( + passSIPlineEdit.text) } } } - Item { - Layout.fillWidth: true - Layout.maximumHeight: 40 - Layout.preferredHeight: 40 - Layout.minimumHeight: 40 + HoverableButtonTextItem { + id: btnDeletAccount + + backgroundColor: "red" + onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7) + onDisabledBackgroundColor: Qt.rgba( + 255 / 256, + 0, 0, 0.8) + onPressColor: backgroundColor + textColor: "white" + + Layout.alignment: Qt.AlignHCenter + Layout.minimumWidth: JamiTheme.preferredButtonWidth + Layout.preferredWidth: JamiTheme.preferredButtonWidth + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + text: qsTr("Delete Account") + font.pointSize: JamiTheme.textFontSize + font.kerning: true + radius: height / 2 + + onClicked: { + delAccountSlot() + } } + } - RowLayout { - Layout.fillWidth: true + RowLayout { + id: rowAdvancedSettingsBtn + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + ElidedTextLabel { - Layout.minimumWidth: 598 - Layout.preferredWidth: 598 + id: lblAdvancedAccountSettings - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight - HoverableRadiusButton { - id: advancedAccountSettingsSIPButton + eText: qsTr("Advanced Account Settings") + fontSize: JamiTheme.headerFontSize + maxWidth: sipAccountViewRect.width - advancedAccountSettingsSIPButton.width - 80 + } - Layout.minimumWidth: 180 + HoverableRadiusButton { + id: advancedAccountSettingsSIPButton - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.leftMargin: JamiTheme.preferredMarginSize - radius: height / 2 + Layout.minimumWidth: JamiTheme.preferredFieldHeight + Layout.preferredWidth: JamiTheme.preferredFieldHeight + Layout.maximumWidth: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - text: qsTr("Advanced Account Settings") - font.pointSize: 10 - font.kerning: true + Layout.alignment: Qt.AlignHCenter - icon.source: { - if (advanceSIPSettingsView.visible) { - return "qrc:/images/icons/round-arrow_drop_up-24px.svg" - } else { - return "qrc:/images/icons/round-arrow_drop_down-24px.svg" - } - } + radius: height / 2 - icon.height: 24 - icon.width: 24 - - onClicked: { - advanceSIPSettingsView.visible = !advanceSIPSettingsView.visible - if(advanceSIPSettingsView.visible){ - advanceSIPSettingsView.updateAccountInfoDisplayedAdvanceSIP() - var coor = advancedAccountSettingsSIPButton.mapToItem(accountSIPLayout,advancedAccountSettingsSIPButton.x,advancedAccountSettingsSIPButton.y) - accountSIPScrollView.vScrollBar.position = coor.y / accountSIPLayout.height - } else { - accountSIPScrollView.vScrollBar.position = 0 - } + icon.source: { + if (advanceSIPSettingsView.visible) { + return "qrc:/images/icons/round-arrow_drop_up-24px.svg" + } else { + return "qrc:/images/icons/round-arrow_drop_down-24px.svg" } } - Item { - Layout.fillWidth: true - Layout.fillHeight: true + onClicked: { + advanceSIPSettingsView.visible = !advanceSIPSettingsView.visible + if(advanceSIPSettingsView.visible){ + advanceSIPSettingsView.updateAccountInfoDisplayedAdvanceSIP() + sipAccountScrollView.vScrollBar.position = rowAdvancedSettingsBtn.y / accountSIPLayout.height + } else { + sipAccountScrollView.vScrollBar.position = 0 + } } } } - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 48 - Layout.preferredHeight: 48 - Layout.maximumHeight: 48 + // instantiate advance setting page + AdvancedSIPSettingsView { + id: advanceSIPSettingsView + Layout.leftMargin: JamiTheme.preferredMarginSize + visible: false } - ColumnLayout { - spacing: 6 + Item { + Layout.preferredWidth: sipAccountViewRect.width - 32 + Layout.minimumWidth: sipAccountViewRect.width - 32 + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32 Layout.fillHeight: true - Layout.fillWidth: true - - Layout.leftMargin: 30 - - // instantiate advance setting page - AdvancedSIPSettingsView { - id: advanceSIPSettingsView - - Layout.leftMargin: 10 - visible: false - } } } } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } } } diff --git a/src/settingsview/components/DeviceItemDelegate.qml b/src/settingsview/components/DeviceItemDelegate.qml index f25026104..b6383601d 100644 --- a/src/settingsview/components/DeviceItemDelegate.qml +++ b/src/settingsview/components/DeviceItemDelegate.qml @@ -31,152 +31,165 @@ ItemDelegate { id: deviceItemDelegate property string deviceName : "" - property string deviceId: "" + property string deviceId : "" property bool isCurrent : false property bool editable : false signal btnRemoveDeviceClicked - function btnEditDeviceEnter(){ + function btnEditDeviceEnter() { btnEditDevice.enterBtn() } - function btnEditDeviceExit(){ + function btnEditDeviceExit() { btnEditDevice.exitBtn() } - function btnEditPress(){ + function btnEditPress() { btnEditDevice.pressBtn() } - function btnEditRelease(){ + function btnEditRelease() { btnEditDevice.releaseBtn() } - function toggleEditable(){ + function toggleEditable() { editable = !editable - if(editable){ - ClientWrapper.settingsAdaptor.setDeviceName(editDeviceName.text) + if (editable) { + ClientWrapper.settingsAdaptor.setDeviceName(elidedTextDeviceName.text) } } highlighted: ListView.isCurrentItem - RowLayout{ + RowLayout { + id: layoutDeviceItemDelegate anchors.fill: parent + spacing: 8 - spacing: 7 + Image { + Layout.leftMargin: 16 + Layout.alignment: Qt.AlignVCenter - Label{ - Layout.leftMargin: 7 - Layout.topMargin: 7 - Layout.bottomMargin: 7 + Layout.minimumWidth: 24 + Layout.preferredWidth: 24 + Layout.maximumWidth: 24 - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - background: Rectangle{ - anchors.fill: parent - Image { - anchors.fill: parent - source: "qrc:/images/icons/baseline-desktop_windows-24px.svg" - } - } + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 + source: "qrc:/images/icons/baseline-desktop_windows-24px.svg" } - ColumnLayout{ + ColumnLayout { + id: col Layout.fillWidth: true - Layout.fillHeight: true - - Layout.topMargin: 7 - Layout.bottomMargin: 7 - - InfoLineEdit{ - id: editDeviceName + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: 16 + RowLayout { Layout.fillWidth: true - Layout.minimumWidth: 0 - Layout.maximumWidth: 16777215 + Layout.alignment: Qt.AlignVCenter - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + InfoLineEdit { + id: editDeviceName - font.pointSize: 8 - font.kerning: true + Layout.preferredWidth: col.width - 100 + Layout.maximumWidth: col.width - 100 + Layout.minimumWidth: col.width - 100 + fieldLayoutWidth: col.width - 100 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - readOnly: !editable + fieldLayoutHeight: 24 - text: deviceName - } - - RowLayout{ - Layout.maximumWidth: editDeviceName.fieldLayoutWidth + Layout.alignment: Qt.AlignLeft + font.pointSize: JamiTheme.textFontSize + font.kerning: true - Layout.minimumHeight: 30 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter - Label{ - id: labelDeviceId + readOnly: !editable - //Layout.minimumWidth: 71 - Layout.minimumHeight: 30 + backgroundColor: "white" - font.pointSize: 8 - font.kerning: true - text: deviceId === "" ? qsTr("Device Id") : deviceId + text: elidedTextDeviceName.elidedText } - Item{ - Layout.fillWidth: true + TextMetrics { + id: elidedTextDeviceName + + elide: Text.ElideRight + elideWidth: deviceItemDelegate.width - 80 - Layout.minimumWidth: 0 - Layout.minimumHeight: 20 + text: deviceName } - Label{ + Label { id: labelThisDevice + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 - //Layout.minimumWidth: 80 - Layout.minimumHeight: 30 + Layout.alignment: Qt.AlignRight + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter visible: isCurrent - font.pointSize: 8 + font.pointSize: JamiTheme.textFontSize font.kerning: true font.italic: true color: "green" text: qsTr("this device") } } + + ElidedTextLabel { + id: labelDeviceId + + Layout.fillWidth: true + + Layout.minimumHeight: 24 + Layout.preferredHeight: 24 + Layout.maximumHeight: 24 + + maxWidth: deviceItemDelegate.width - 80 + eText: deviceId === "" ? qsTr("Device Id") : deviceId + } + } - HoverableRadiusButton{ + HoverableRadiusButton { id: btnEditDevice - Layout.topMargin: 7 - Layout.bottomMargin: 7 + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + Layout.rightMargin: 8 - Layout.minimumWidth: 30 - Layout.preferredWidth: 30 - Layout.maximumWidth: 30 + Layout.minimumWidth: 32 + Layout.preferredWidth: 32 + Layout.maximumWidth: 32 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: 32 + Layout.preferredHeight: 32 + Layout.maximumHeight: 32 - buttonImageHeight: height - buttonImageWidth: height + buttonImageHeight: height - 8 + buttonImageWidth: width - 8 - source:{ + radius: height / 2 + width: 25 + height: 25 + + backgroundColor: "transparent" + + source: { if(isCurrent) { var path = editable ? "qrc:/images/icons/round-edit-24px.svg" : "qrc:/images/icons/round-save_alt-24px.svg" return path @@ -188,7 +201,7 @@ ItemDelegate { ToolTip.visible: isHovering ToolTip.text: { if(isCurrent) { - if(editable){ + if (editable) { return qsTr("Edit Device Name") } else { return qsTr("Save new device name") @@ -206,15 +219,5 @@ ItemDelegate { } } } - - Item{ - Layout.rightMargin: 7 - - Layout.minimumWidth: 8 - Layout.preferredWidth: 8 - Layout.maximumWidth: 8 - - Layout.minimumHeight: 20 - } } } diff --git a/src/settingsview/components/GeneralSettingsPage.qml b/src/settingsview/components/GeneralSettingsPage.qml index 50895fbeb..008ba6b99 100644 --- a/src/settingsview/components/GeneralSettingsPage.qml +++ b/src/settingsview/components/GeneralSettingsPage.qml @@ -74,7 +74,7 @@ Rectangle { updateRecordQualityTimer.restart() } - Timer { + Timer{ id: updateRecordQualityTimer interval: 500 @@ -148,6 +148,9 @@ Rectangle { //property AVModel avmodel: ClientWrapper.accountAdaptor.avModel() property string recordPath: ClientWrapper.settingsAdaptor.getDir_Document() + property int preferredColumnWidth : generalSettingsScrollView.width / 2 - 50 + property int preferredSettingsWidth : generalSettingsScrollView.width - 100 + signal backArrowClicked onDownloadPathChanged: { @@ -164,512 +167,472 @@ Rectangle { } Layout.fillHeight: true - Layout.fillWidth: true - - ScrollView { - anchors.fill: parent - clip: true - - ColumnLayout { - spacing: 8 - - Layout.fillHeight: true - Layout.maximumWidth: 580 - Layout.preferredWidth: 580 - Layout.minimumWidth: 580 - - RowLayout { + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView + anchors.centerIn: parent + + ColumnLayout { + anchors.fill: generalSettingsRect + + RowLayout { + id: generalSettingsTitle + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: JamiTheme.preferredMarginSize + Layout.fillWidth: true + Layout.maximumHeight: 64 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 + + HoverableButton { + id: backToSettingsMenuButton + + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.preferredWidth: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.rightMargin: JamiTheme.preferredMarginSize + + radius: 32 + source: "qrc:/images/icons/ic_arrow_back_24px.svg" + backgroundColor: "white" + onExitColor: "white" + + visible: mainViewWindow.sidePanelHidden + + onClicked: { + backArrowClicked() + } + } - Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter - Layout.leftMargin: 16 + Label { Layout.fillWidth: true - Layout.maximumHeight: 64 - Layout.minimumHeight: 64 - Layout.preferredHeight: 64 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - HoverableButton { - id: backToSettingsMenuButton + text: qsTr("General") + font.pointSize: JamiTheme.titleFontSize + font.kerning: true - Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft - Layout.preferredWidth: 30 - Layout.preferredHeight: 30 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } - radius: 30 - source: "qrc:/images/icons/ic_arrow_back_24px.svg" - backgroundColor: "white" - onExitColor: "white" + } - visible: mainViewWindow.sidePanelHidden + ScrollView{ + id: generalSettingsScrollView + property ScrollBar vScrollBar: ScrollBar.vertical - onClicked: { - backArrowClicked() - } - } + Layout.fillHeight: true + Layout.fillWidth: true - Label { - Layout.fillWidth: true - Layout.minimumHeight: 64 - Layout.preferredHeight: 64 - Layout.maximumHeight: 64 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - text: qsTr("General") - font.pointSize: JamiTheme.titleFontSize - font.kerning: true + width: generalSettingsRect.width + height: generalSettingsRect.height - generalSettingsTitle.height - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - } + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + ScrollBar.vertical.policy: ScrollBar.AsNeeded + + clip: true - // system setting panel ColumnLayout { - spacing: 6 + Layout.fillHeight: true Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter - Label { - Layout.fillWidth: true - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 - - text: qsTr("System") - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 - } + spacing: 24 + // system setting panel ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - ToggleSwitch { - id: notificationCheckBox - - Layout.leftMargin: 20 + Label { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - labelText: "Enable desktop notifications" - fontPointSize: 11 + text: qsTr("System") + font.pointSize: JamiTheme.headerFontSize + font.kerning: true - onSwitchToggled: { - slotSetNotifications(checked) - } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter } - ToggleSwitch { - id: closeOrMinCheckBox + ColumnLayout { + spacing: 8 + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Layout.leftMargin: 20 + ToggleSwitch { + id: notificationCheckBox - labelText: "Keep minimize on close" - fontPointSize: 11 + labelText: desktopNotificationsElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize - onSwitchToggled: { - slotSetClosedOrMin(checked) + onSwitchToggled: { + slotSetNotifications(checked) + } } - } - ToggleSwitch { - id: applicationOnStartUpCheckBox + TextMetrics { + id: desktopNotificationsElidedText + elide: Text.ElideRight + elideWidth: preferredSettingsWidth + text: qsTr("Enable desktop notifications") + } - Layout.leftMargin: 20 - labelText: "Run on Startup" - fontPointSize: 11 + ToggleSwitch { + id: closeOrMinCheckBox - onSwitchToggled: { - slotSetRunOnStartUp(checked) - } - } + labelText: keepMinimizeElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize - RowLayout { - spacing: 6 + onSwitchToggled: { + slotSetClosedOrMin(checked) + } + } - Layout.leftMargin: 20 - Layout.fillWidth: true - Layout.maximumHeight: 30 + TextMetrics { + id: keepMinimizeElidedText + elide: Text.ElideRight + elideWidth: preferredSettingsWidth + text: qsTr("Keep minimize on close") + } - Label { - Layout.fillHeight: true - Layout.maximumWidth: 94 - Layout.preferredWidth: 94 - Layout.minimumWidth: 94 + ToggleSwitch { + id: applicationOnStartUpCheckBox - text: qsTr("Download folder") - font.pointSize: 10 - font.kerning: true + labelText: runOnStartupElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + onSwitchToggled: { + slotSetRunOnStartUp(checked) + } } - Item { - Layout.fillHeight: true - Layout.fillWidth: true + TextMetrics { + id: runOnStartupElidedText + elide: Text.ElideRight + elideWidth: preferredSettingsWidth + text: qsTr("Run On Startup") } - HoverableRadiusButton { - id: downloadButton - - Layout.maximumWidth: 320 - Layout.preferredWidth: 320 - Layout.minimumWidth: 320 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 - - radius: height / 2 + RowLayout { + spacing: 8 + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - icon.source: "qrc:/images/icons/round-folder-24px.svg" - icon.height: 24 - icon.width: 24 + ElidedTextLabel { - text: downloadPath - fontPointSize: 10 + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight - onClicked: { - openDownloadFolderSlot() + eText: qsTr("Downloads folder") + font.pointSize: JamiTheme.settingsFontSize + maxWidth: preferredColumnWidth } - } - } - } - } - Item { - Layout.fillWidth: true - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } + HoverableRadiusButton { + id: downloadButton - // call recording setting panel - ColumnLayout { - spacing: 6 - Layout.fillWidth: true + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth - Label { - Layout.fillWidth: true - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - text: qsTr("Call Recording") - font.pointSize: 13 - font.kerning: true + Layout.alignment: Qt.AlignRight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + radius: height / 2 - Item { - Layout.fillWidth: true + icon.source: "qrc:/images/icons/round-folder-24px.svg" + icon.height: 24 + icon.width: 24 + + text: downloadPath + fontPointSize: JamiTheme.buttonFontSize - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + onClicked: { + openDownloadFolderSlot() + } + } + } + } } + // call recording setting panel ColumnLayout { - spacing: 6 + spacing: 8 Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - ToggleSwitch { - id: alwaysRecordingCheckBox - - Layout.leftMargin: 20 - - labelText: "Always record calls" - fontPointSize: 11 + ElidedTextLabel { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - onSwitchToggled: { - slotAlwaysRecordingClicked(checked) - } + eText: qsTr("Call Recording") + font.pointSize: JamiTheme.headerFontSize + maxWidth: preferredSettingsWidth } - ToggleSwitch { - id: recordPreviewCheckBox + ColumnLayout { + spacing: 8 + Layout.fillWidth: true + Layout.leftMargin: JamiTheme.preferredMarginSize - Layout.leftMargin: 20 + ToggleSwitch { + id: alwaysRecordingCheckBox - labelText: "Record preview video for a call" - fontPointSize: 11 + labelText: alwaysRecordElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize - onSwitchToggled: { - slotRecordPreviewClicked(checked) + onSwitchToggled: { + slotAlwaysRecordingClicked(checked) + } } - } - RowLayout { - spacing: 6 - Layout.leftMargin: 20 - Layout.fillWidth: true - Layout.maximumHeight: 30 + TextMetrics { + id: alwaysRecordElidedText + elide: Text.ElideRight + elideWidth: preferredSettingsWidth + text: qsTr("Always record calls") + } - Label { - Layout.fillHeight: true - Layout.maximumWidth: 42 - Layout.preferredWidth: 42 - Layout.minimumWidth: 42 + ToggleSwitch { + id: recordPreviewCheckBox - text: qsTr("Quality") - font.pointSize: 10 - font.kerning: true + labelText: recordPreviewElidedText.elidedText + fontPointSize: JamiTheme.settingsFontSize - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + onSwitchToggled: { + slotRecordPreviewClicked(checked) + } } - Item { - Layout.fillHeight: true - Layout.fillWidth: true + TextMetrics { + id: recordPreviewElidedText + elide: Text.ElideRight + elideWidth: preferredSettingsWidth + text: qsTr("Record preview video for a call") } - ColumnLayout { - spacing: 0 - Layout.fillHeight: true + RowLayout { + spacing: 8 + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + + Label { - Layout.maximumWidth: recordQualityValueLabel.width - Item { - Layout.fillHeight: true Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.minimumHeight: JamiTheme.preferredFieldHeight + + text: qsTr("Quality") + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true + + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter } Label { id: recordQualityValueLabel - Layout.minimumWidth: 40 + Layout.minimumWidth: 50 + Layout.preferredWidth: 50 + Layout.maximumWidth: 50 - Layout.minimumHeight: 16 - Layout.preferredHeight: 16 - Layout.maximumHeight: 16 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight text: qsTr("VALUE ") - font.pointSize: 10 + font.pointSize: JamiTheme.settingsFontSize font.kerning: true horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - } - - Slider { - id: recordQualitySlider + Slider{ + id: recordQualitySlider - Layout.fillHeight: true + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth - Layout.maximumWidth: 320 - Layout.preferredWidth: 320 - Layout.minimumWidth: 320 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - from: 0 - to: 500 - stepSize: 1 + from: 0 + to: 500 + stepSize: 1 - onMoved: { - slotRecordQualitySliderValueChanged(value) + onMoved: { + slotRecordQualitySliderValueChanged(value) + } } } - } - - RowLayout { - spacing: 6 - - Layout.leftMargin: 20 - Layout.fillWidth: true - Layout.maximumHeight: 30 - Label { - Layout.fillHeight: true + RowLayout { + spacing: 8 + Layout.fillWidth: true + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.maximumWidth: 42 - Layout.preferredWidth: 42 - Layout.minimumWidth: 42 + Label { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - text: qsTr("Save in") - font.pointSize: 10 - font.kerning: true + text: qsTr("Save in") + font.pointSize: JamiTheme.settingsFontSize + font.kerning: true - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + HoverableRadiusButton { + id: recordPathButton - HoverableRadiusButton { - id: recordPathButton + Layout.leftMargin: JamiTheme.preferredMarginSize + Layout.maximumWidth: preferredColumnWidth + Layout.preferredWidth: preferredColumnWidth + Layout.minimumWidth: preferredColumnWidth - Layout.maximumWidth: 320 - Layout.preferredWidth: 320 - Layout.minimumWidth: 320 + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.alignment: Qt.AlignRight - radius: height / 2 + radius: height / 2 - icon.source: "qrc:/images/icons/round-folder-24px.svg" - icon.height: 24 - icon.width: 24 + icon.source: "qrc:/images/icons/round-folder-24px.svg" + icon.height: 24 + icon.width: 24 - text: recordPath - fontPointSize: 10 + text: recordPath + fontPointSize: JamiTheme.buttonFontSize - onClicked: { - openRecordFolderSlot() + onClicked: { + openRecordFolderSlot() + } } } } } - } - Item { - Layout.fillWidth: true - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 - } - - // update setting panel - ColumnLayout { - spacing: 6 - Layout.fillWidth: true - visible: Qt.platform.os == "windows"? true : false - - Label { + // update setting panel + ColumnLayout { + spacing: 8 Layout.fillWidth: true - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 + Layout.leftMargin: JamiTheme.preferredMarginSize + visible: Qt.platform.os == "windows"? true : false - text: qsTr("Updates") - font.pointSize: 13 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true + Label { + Layout.fillWidth: true + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 - } + text: qsTr("Updates") + font.pointSize: JamiTheme.headerFontSize + font.kerning: true - ColumnLayout { - spacing: 6 - Layout.fillWidth: true + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } - ToggleSwitch { - id: autoUpdateCheckBox + ColumnLayout { + spacing: 8 + Layout.fillWidth: true - Layout.leftMargin: 20 + ToggleSwitch { + id: autoUpdateCheckBox - labelText: "Check for updates automatically" - fontPointSize: 11 + labelText: autoUpdateText.elidedText + fontPointSize: JamiTheme.settingsFontSize - onSwitchToggled: { - slotSetUpdateAutomatic(checked) + onSwitchToggled: { + slotSetUpdateAutomatic(checked) + } } - } - RowLayout { - spacing: 6 - - Layout.leftMargin: 20 - Layout.fillWidth: true - Layout.maximumHeight: 30 + TextMetrics { + id: autoUpdateText + elide: Text.ElideRight + elideWidth: preferredSettingsWidth + text: qsTr("Check for updates automatically") + } HoverableRadiusButton { id: checkUpdateButton - Layout.maximumWidth: 275 - Layout.preferredWidth: 275 - Layout.minimumWidth: 275 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.alignment: Qt.AlignHCenter + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.preferredWidth: JamiTheme.preferredButtonWidth + Layout.minimumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight radius: height / 2 - text: "Check for updates now" - fontPointSize: 10 + text: qsTr("Check for updates now") + fontPointSize: JamiTheme.buttonFontSize onClicked: { checkForUpdateSlot() } } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - } - - RowLayout { - spacing: 6 - - Layout.leftMargin: 20 - Layout.fillWidth: true - Layout.maximumHeight: 30 - HoverableRadiusButton { id: installBetaButton - Layout.maximumWidth: 275 - Layout.preferredWidth: 275 - Layout.minimumWidth: 275 - - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.alignment: Qt.AlignHCenter + Layout.maximumWidth: JamiTheme.preferredButtonWidth + Layout.preferredWidth: JamiTheme.preferredButtonWidth + Layout.minimumWidth: JamiTheme.preferredButtonWidth + Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.maximumHeight: JamiTheme.preferredFieldHeight radius: height / 2 text: "Install the latest beta version" - fontPointSize: 10 + fontPointSize: JamiTheme.buttonFontSize onClicked: { installBetaSlot() } } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } } } - } - // spacer on the bottom - Item { - Layout.fillHeight: true - Layout.fillWidth: true + Item { + Layout.preferredWidth: generalSettingsRect.width - 32 + Layout.minimumWidth: generalSettingsRect.width - 32 + Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32 + Layout.fillHeight: true + } } } } diff --git a/src/settingsview/components/IconButton.qml b/src/settingsview/components/IconButton.qml index 7e992a9e3..5e40da679 100644 --- a/src/settingsview/components/IconButton.qml +++ b/src/settingsview/components/IconButton.qml @@ -56,9 +56,9 @@ Button { setCheckedState(true, true) } - Layout.minimumHeight: 60 - Layout.preferredHeight: 60 - Layout.maximumHeight: 60 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 + Layout.maximumHeight: 64 Layout.fillWidth: true @@ -92,7 +92,7 @@ Button { Layout.fillHeight: true Layout.fillWidth: true - font.pointSize: 11 + font.pointSize: JamiTheme.textFontSize+2 font.kerning: true horizontalAlignment: Text.AlignLeft diff --git a/src/settingsview/components/SettingParaCombobox.qml b/src/settingsview/components/SettingParaCombobox.qml index b691acb29..dc447a654 100644 --- a/src/settingsview/components/SettingParaCombobox.qml +++ b/src/settingsview/components/SettingParaCombobox.qml @@ -23,6 +23,7 @@ import QtQuick.Controls.Universal 2.12 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.14 import QtQuick.Controls.Styles 1.4 +import "../../constant" ComboBox { id: control @@ -63,7 +64,7 @@ ComboBox { context.lineTo(width, 0); context.lineTo(width / 2, height); context.closePath(); - context.fillStyle = control.pressed ? "#17a81a" : "#21be2b"; + context.fillStyle = control.pressed ? JamiTheme.pressColor : "black"; context.fill(); } } diff --git a/src/settingsview/components/ToggleSwitch.qml b/src/settingsview/components/ToggleSwitch.qml index 27c84bdc1..3b9d0f12d 100644 --- a/src/settingsview/components/ToggleSwitch.qml +++ b/src/settingsview/components/ToggleSwitch.qml @@ -23,9 +23,10 @@ import QtQuick.Controls.Universal 2.12 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.14 import QtQuick.Controls.Styles 1.4 +import "../../commoncomponents" RowLayout { - property string labelText: value + property string labelText: "" property int widthOfSwitch: 50 property int heightOfSwitch: 10 property int heightOfLayout: 30 @@ -36,13 +37,26 @@ RowLayout { signal switchToggled - spacing: 18 + spacing: 8 Layout.fillWidth: true - Layout.maximumHeight: 30 + Layout.maximumHeight: 32 + + ElidedTextLabel { + Layout.fillWidth: true + + Layout.minimumHeight: heightOfLayout + Layout.preferredHeight: heightOfLayout + Layout.maximumHeight: heightOfLayout + + eText: qsTr(labelText) + fontSize: fontPointSize + maxWidth: parent.width - widthOfSwitch + + } Switch { id: switchOfLayout - Layout.alignment: Qt.AlignVCenter + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.maximumWidth: widthOfSwitch Layout.preferredWidth: widthOfSwitch @@ -56,19 +70,4 @@ RowLayout { switchToggled() } } - - Label { - Layout.fillWidth: true - - Layout.minimumHeight: heightOfLayout - Layout.preferredHeight: heightOfLayout - Layout.maximumHeight: heightOfLayout - - text: qsTr(labelText) - font.pointSize: fontPointSize - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } } -- GitLab