diff --git a/qml.qrc b/qml.qrc index fbc901d68af556ed770bd21fde539476534ef6e1..6a45fb228895c60058137d1b250ea7aae34bcd74 100644 --- a/qml.qrc +++ b/qml.qrc @@ -38,7 +38,7 @@ <file>src/commoncomponents/DeleteAccountDialog.qml</file> <file>src/commoncomponents/MessageBox.qml</file> <file>src/wizardview/WizardView.qml</file> - <file>src/wizardview/components/WelcomePageLayout.qml</file> + <file>src/wizardview/components/WelcomePage.qml</file> <file>src/wizardview/components/CreateAccountPage.qml</file> <file>src/wizardview/components/CreateSIPAccountPage.qml</file> <file>src/wizardview/components/ImportFromBackupPage.qml</file> @@ -109,5 +109,7 @@ <file>src/commoncomponents/BaseContextMenu.qml</file> <file>src/mainview/components/AccountPresenceCycle.qml</file> <file>src/commoncomponents/Scaffold.qml</file> + <file>src/constant/JamiQmlUtils.qml</file> + <file>src/wizardview/components/AccountCreationStepIndicator.qml</file> </qresource> </RCC> diff --git a/resources.qrc b/resources.qrc index 51835ea35af541a38cb14aae623cd87f6cedd49f..52770ec71bbd41fad7c8b5fd60f17e577c895636 100644 --- a/resources.qrc +++ b/resources.qrc @@ -35,8 +35,6 @@ <file>images/icons/ic_arrow_forward_white_48dp_2x.png</file> <file>images/icons/ic_arrow_tab_next_black_9dp_2x.png</file> <file>images/icons/ic_arrow_tab_previous_black_9dp_2x.png</file> - <file>images/icons/check_box-24px.svg</file> - <file>images/icons/check_box_outline_blank-24px.svg</file> <file>images/icons/ic_block_24px.svg</file> <file>images/icons/delete_forever-24px.svg</file> <file>images/icons/phone_forwarded-24px.svg</file> diff --git a/src/MainApplicationWindow.qml b/src/MainApplicationWindow.qml index 8fb5cbb64484dace2c27b39eb423c12d05a48861..8a5b9eb1596b8833438da22b10b5ce796d008cea 100644 --- a/src/MainApplicationWindow.qml +++ b/src/MainApplicationWindow.qml @@ -93,13 +93,14 @@ ApplicationWindow { title: "Jami" - minimumWidth: 400 + minimumWidth: 500 minimumHeight: 600 WizardView { id: wizardViewForApplicationStart anchors.fill: parent + onNeedToShowMainViewWindow: { mainViewLoader.newAddedAccountIndex = accountIndex if (mainViewLoader.source.toString() !== "qrc:/src/mainview/MainView.qml") { @@ -146,7 +147,7 @@ ApplicationWindow { Connections { target: ClientWrapper.lrcInstance - onRestoreAppRequested: { + function onRestoreAppRequested() { if (mainViewLoader.item) mainViewLoader.item.show() else diff --git a/src/commoncomponents/MaterialButton.qml b/src/commoncomponents/MaterialButton.qml index 69400faa15cf40132c83f49b213322a6e2a0844b..54f32fa476a9ade76b04ada401b5ff17d2ebca7a 100644 --- a/src/commoncomponents/MaterialButton.qml +++ b/src/commoncomponents/MaterialButton.qml @@ -17,7 +17,6 @@ */ import QtQuick 2.14 -import QtQuick.Layouts 1.3 import QtQuick.Controls 2.14 import QtGraphicalEffects 1.15 @@ -31,9 +30,8 @@ Button { property var pressedColor: undefined property var outlined: false - Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: 400 - Layout.preferredHeight: 36 + property var preferredWidth: 400 + property var preferredHeight: 36 font.kerning: true @@ -114,4 +112,4 @@ Button { } radius: 4 } -} \ No newline at end of file +} diff --git a/src/commoncomponents/MaterialLineEdit.qml b/src/commoncomponents/MaterialLineEdit.qml index afb08fc1a40f668305d71a42b440537ed6612e56..f7a43222ee99c7d5ee7fcb4d43d9c1024c18f41e 100644 --- a/src/commoncomponents/MaterialLineEdit.qml +++ b/src/commoncomponents/MaterialLineEdit.qml @@ -48,17 +48,6 @@ TextField { signal imageClicked - Layout.minimumHeight: fieldLayoutHeight - Layout.preferredHeight: fieldLayoutHeight - Layout.maximumHeight: fieldLayoutHeight - - Layout.minimumWidth: fieldLayoutWidth - Layout.maximumWidth: fieldLayoutWidth - Layout.preferredWidth: fieldLayoutWidth - - Layout.fillWidth: layoutFillwidth - Layout.alignment: Qt.AlignHCenter - wrapMode: Text.Wrap readOnly: false selectByMouse: true diff --git a/src/commoncomponents/PhotoboothView.qml b/src/commoncomponents/PhotoboothView.qml index f9ce5f427719e17b5264ddc2409c53ec1185b60c..0eec04a7dbfb31806a77b91014e2daa58fa35cea 100644 --- a/src/commoncomponents/PhotoboothView.qml +++ b/src/commoncomponents/PhotoboothView.qml @@ -13,6 +13,7 @@ ColumnLayout{ property string imgBase64: "" property string fileName: "" + readonly property int preferredWidth: boothWidth + buttonsRowLayout.height property int boothWidth: 224 signal imageAcquired @@ -73,27 +74,13 @@ ColumnLayout{ spacing: 0 - Layout.maximumWidth: boothWidth - Layout.preferredWidth: boothWidth - Layout.minimumWidth: boothWidth - - Layout.maximumHeight: 0 - - Layout.alignment: Qt.AlignHCenter - Label{ id: avatarLabel visible: !takePhotoState - Layout.maximumWidth: boothWidth Layout.preferredWidth: boothWidth - Layout.minimumWidth: boothWidth - - Layout.maximumHeight: boothWidth Layout.preferredHeight: boothWidth - Layout.minimumHeight: boothWidth - Layout.alignment: Qt.AlignHCenter background: Rectangle { @@ -140,13 +127,8 @@ ColumnLayout{ focus: visible Layout.alignment: Qt.AlignHCenter - Layout.maximumWidth: boothWidth Layout.preferredWidth: boothWidth - Layout.minimumWidth: boothWidth - - Layout.maximumHeight: boothWidth Layout.preferredHeight: boothWidth - Layout.minimumHeight: boothWidth layer.enabled: true layer.effect: OpacityMask { @@ -177,16 +159,15 @@ ColumnLayout{ } } - RowLayout{ + id: buttonsRowLayout + Layout.fillWidth: true - Layout.minimumHeight: 30 - Layout.maximumHeight: 30 + Layout.alignment: Qt.AlignHCenter + Layout.preferredHeight: 30 + Layout.topMargin: 5 - Item{ - Layout.fillWidth: true - Layout.fillHeight: true - } + spacing: 15 HoverableButton { id: takePhotoButton @@ -195,13 +176,9 @@ ColumnLayout{ property string addPhotoIconUrl: "qrc:/images/icons/round-add_a_photo-24px.svg" property string refreshIconUrl: "qrc:/images/icons/baseline-refresh-24px.svg" - Layout.maximumWidth: 30 Layout.preferredWidth: 30 - Layout.minimumWidth: 30 - - Layout.minimumHeight: 30 Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.alignment: Qt.AlignHCenter text: "" font.pointSize: 10 @@ -244,24 +221,12 @@ ColumnLayout{ } } - Item{ - Layout.fillHeight: true - - Layout.minimumWidth: 6 - Layout.preferredWidth: 6 - Layout.maximumWidth: 6 - } - HoverableButton { id: importButton - Layout.maximumWidth: 30 Layout.preferredWidth: 30 - Layout.minimumWidth: 30 - - Layout.minimumHeight: 30 Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.alignment: Qt.AlignHCenter text: "" font.pointSize: 10 @@ -276,10 +241,5 @@ ColumnLayout{ importFromFileToAvatar_Dialog.open() } } - - Item{ - Layout.fillWidth: true - Layout.fillHeight: true - } } } diff --git a/src/constant/JamiQmlUtils.qml b/src/constant/JamiQmlUtils.qml new file mode 100644 index 0000000000000000000000000000000000000000..a461f1d81451651733ff32507157bb7cd8c00856 --- /dev/null +++ b/src/constant/JamiQmlUtils.qml @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2020 by Savoir-faire Linux + * Author: Mingrui Zhang <mingrui.zhang@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/>. + */ + +// JamiQmlUtils as a singleton is to provide global property entry +pragma Singleton + +import QtQuick 2.14 + +Item { + TextMetrics { + id: globalTextMetrics + } + + function getTextBoundingRect(font, text) { + globalTextMetrics.font = font + globalTextMetrics.text = text + + return globalTextMetrics.boundingRect + } +} diff --git a/src/constant/JamiTheme.qml b/src/constant/JamiTheme.qml index 7df3a40e5cf65b2715fb6e2fb119efad2932d52e..09fec0d52c9a5b973954b801dcec54e90641ed00 100644 --- a/src/constant/JamiTheme.qml +++ b/src/constant/JamiTheme.qml @@ -1,4 +1,3 @@ - /* * Copyright (C) 2020 by Savoir-faire Linux * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> @@ -17,21 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ - -/* - * JamiTheme as a singleton is to provide global property entry - * https://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterSingletonType-3 - */ +// JamiTheme as a singleton is to provide global theme property entry. pragma Singleton import QtQuick 2.14 Item { - - - /* - * Color strings. - */ + // Color strings. property string hoverColor: "#c7c7c7" property string pressColor: "#c0c0c0" property string releaseColor: "#e0e0e0" @@ -83,9 +74,10 @@ Item { property string sipInputButtonHoverColor: "#4477aa" property string sipInputButtonPressColor: "#5588bb" - /* - * Font. - */ + property string accountCreationOtherStepColor: "grey" + property string accountCreationCurrentStepColor: "#28b1ed" + + // Font. property string faddedFontColor: "#c0c0c0" property string faddedLastInteractionFontColor: "#505050" @@ -102,10 +94,7 @@ Item { property int preferredFieldHeight: 32 property int preferredMarginSize: 16 - - /* - * Place holder text. - */ + // Place holder text. property string contactSearchBarPlaceHolderConversationText: qsTr("Find or start a conversation") property string contactSearchBarPlaceHolderInivitionText: qsTr("Search your invitations") diff --git a/src/qmlregister.cpp b/src/qmlregister.cpp index 0155378e064cff505497137e0da16ddc8ee12352..11301adf1ade5c4ceece213805ec6d5d303d60fe 100644 --- a/src/qmlregister.cpp +++ b/src/qmlregister.cpp @@ -128,10 +128,12 @@ void registerTypes() QML_REGISTERTYPE(PhotoboothPreviewRender, 1, 0) /* - * Adaptors - qmlRegisterSingletonType. + * Adaptors and qml singleton components - qmlRegisterSingletonType. */ QML_REGISTERSINGLETONTYPE_URL(QStringLiteral("qrc:/src/constant/JamiTheme.qml"), JamiTheme, 1, 0); + QML_REGISTERSINGLETONTYPE_URL(QStringLiteral("qrc:/src/constant/JamiQmlUtils.qml"), + JamiQmlUtils, 1, 0); QML_REGISTERSINGLETONTYPE("net.jami.Models", CallAdapter, 1, 0); QML_REGISTERSINGLETONTYPE("net.jami.Models", MessagesAdapter, 1, 0); diff --git a/src/settingsview/components/AdvancedSIPSettingsView.qml b/src/settingsview/components/AdvancedSIPSettingsView.qml index 98280a16ec7126caaa9875c936ebb7be326cdba4..759a3f7b150c056d6cbee097d0c389554cbef523 100644 --- a/src/settingsview/components/AdvancedSIPSettingsView.qml +++ b/src/settingsview/components/AdvancedSIPSettingsView.qml @@ -418,13 +418,9 @@ ColumnLayout { MaterialButton { id: btnRingtoneSIP - Layout.minimumWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -480,8 +476,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditVoiceMailDialCode - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -619,12 +617,9 @@ ColumnLayout { MaterialButton { id: btnSIPCACert - Layout.minimumWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -651,13 +646,9 @@ ColumnLayout { MaterialButton { id: btnSIPUserCert - Layout.minimumWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -684,13 +675,9 @@ ColumnLayout { MaterialButton { id: btnSIPPrivateKey - Layout.minimumWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -719,8 +706,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditSIPCertPassword - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -853,8 +842,10 @@ ColumnLayout { MaterialLineEdit { id: outgoingTLSServerNameLineEdit - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -1059,8 +1050,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditTurnAddressSIP - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -1089,8 +1082,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditTurnUsernameSIP - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -1118,8 +1113,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditTurnPsswdSIP - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -1150,8 +1147,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditTurnRealmSIP - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -1195,8 +1194,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditSTUNAddressSIP - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -1279,8 +1280,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditSIPCustomAddress - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize diff --git a/src/settingsview/components/AdvancedSettingsView.qml b/src/settingsview/components/AdvancedSettingsView.qml index a75306ddc4623558338dea17fafe617e6b365b50..2b28273cb73a960647d371b560c54834d5e9e39a 100644 --- a/src/settingsview/components/AdvancedSettingsView.qml +++ b/src/settingsview/components/AdvancedSettingsView.qml @@ -366,12 +366,9 @@ ColumnLayout { MaterialButton { id: btnRingtone - Layout.minimumWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -436,8 +433,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditNameServer - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -501,8 +500,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditProxy - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -539,8 +540,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditBootstrap - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -599,13 +602,9 @@ ColumnLayout { MaterialButton { id: btnCACert - Layout.minimumWidth: preferredColumnWidth - Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -632,13 +631,9 @@ ColumnLayout { MaterialButton { id: btnUserCert - Layout.minimumWidth: preferredColumnWidth - Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -665,13 +660,9 @@ ColumnLayout { MaterialButton { id: btnPrivateKey - Layout.minimumWidth: preferredColumnWidth - Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth source: "qrc:/images/icons/round-folder-24px.svg" color: JamiTheme.buttonTintedGrey @@ -699,8 +690,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditCertPassword - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -798,8 +791,11 @@ ColumnLayout { MaterialLineEdit { id: lineEditTurnAddress - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -832,8 +828,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditTurnUsername - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize @@ -864,11 +862,13 @@ ColumnLayout { MaterialLineEdit { id: lineEditTurnPassword - layer.mipmap: false - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 + layer.mipmap: false font.pointSize: JamiTheme.settingsFontSize font.kerning: true @@ -918,8 +918,10 @@ ColumnLayout { MaterialLineEdit { id: lineEditSTUNAddress - fieldLayoutWidth: preferredColumnWidth - fieldLayoutHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth + padding: 8 font.pointSize: JamiTheme.settingsFontSize diff --git a/src/settingsview/components/CurrentAccountSettingsScrollPage.qml b/src/settingsview/components/CurrentAccountSettingsScrollPage.qml index f885ddc7a440d2c3fa0896a505f84256dae579c5..a94dac9ba3e663af1507ec551723e7c634bd4eb4 100644 --- a/src/settingsview/components/CurrentAccountSettingsScrollPage.qml +++ b/src/settingsview/components/CurrentAccountSettingsScrollPage.qml @@ -575,12 +575,9 @@ Rectangle { MaterialLineEdit { id: displayNameLineEdit - Layout.maximumWidth: JamiTheme.preferredFieldWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - - Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: JamiTheme.preferredFieldWidth font.pointSize: JamiTheme.textFontSize font.kerning: true @@ -704,12 +701,10 @@ Rectangle { MaterialLineEdit { id: currentRegisteredID - Layout.minimumWidth: preferredColumnWidth - Layout.preferredWidth: preferredColumnWidth - Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight + + Layout.alignment: Qt.AlignCenter Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth placeholderText: { refreshVariable var result = registeredIdNeedsSet ? @@ -779,6 +774,10 @@ Rectangle { MaterialButton { id: passwdPushButton + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: JamiTheme.preferredFieldWidth + Layout.preferredHeight: JamiTheme.preferredFieldHeight + visible: SettingsAdapter.getAccountConfig_Manageruri() === "" color: JamiTheme.buttonTintedBlack @@ -786,14 +785,6 @@ Rectangle { pressedColor: JamiTheme.buttonTintedBlackPressed outlined: true - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumWidth: JamiTheme.preferredFieldWidth - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.maximumWidth: JamiTheme.preferredFieldWidth - Layout.alignment: Qt.AlignHCenter - toolTipText: ClientWrapper.accountAdaptor.hasPassword() ? qsTr("Change the current password") : qsTr("Currently no password, press this button to set a password") @@ -810,6 +801,10 @@ Rectangle { MaterialButton { id: btnExportAccount + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: JamiTheme.preferredFieldWidth + Layout.preferredHeight: JamiTheme.preferredFieldHeight + visible: SettingsAdapter.getAccountConfig_Manageruri() === "" color: JamiTheme.buttonTintedBlack @@ -817,14 +812,6 @@ Rectangle { pressedColor: JamiTheme.buttonTintedBlackPressed outlined: true - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumWidth: JamiTheme.preferredFieldWidth - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.maximumWidth: JamiTheme.preferredFieldWidth - Layout.alignment: Qt.AlignHCenter - toolTipText: qsTr("Press this button to export account to a .gz file") text: qsTr("Export Account") @@ -838,18 +825,14 @@ Rectangle { MaterialButton { id: btnDeleteAccount + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: JamiTheme.preferredFieldWidth + Layout.preferredHeight: JamiTheme.preferredFieldHeight + color: JamiTheme.buttonTintedRed hoveredColor: JamiTheme.buttonTintedRedHovered pressedColor: JamiTheme.buttonTintedRedPressed - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumWidth: JamiTheme.preferredFieldWidth - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.maximumWidth: JamiTheme.preferredFieldWidth - Layout.alignment: Qt.AlignHCenter - toolTipText: qsTr("Press this button to delete this account") text: qsTr("Delete Account") @@ -918,15 +901,11 @@ Rectangle { MaterialButton { id: linkDevPushButton - visible: SettingsAdapter.getAccountConfig_Manageruri() === "" - - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - Layout.minimumWidth: JamiTheme.preferredFieldWidth - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.maximumWidth: JamiTheme.preferredFieldWidth Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: JamiTheme.preferredFieldWidth + Layout.preferredHeight: JamiTheme.preferredFieldHeight + + visible: SettingsAdapter.getAccountConfig_Manageruri() === "" color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml b/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml index 9d93bbfe23bb6b02be9d392f0c819f87c88fb919..80cc11629e946772cb58beaa6df452c905386373 100644 --- a/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml +++ b/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml @@ -232,12 +232,9 @@ Rectangle { MaterialLineEdit { id: displaySIPNameLineEdit - Layout.maximumWidth: JamiTheme.preferredFieldWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight + Layout.alignment: Qt.AlignCenter Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - - Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: JamiTheme.preferredFieldWidth font.pointSize: JamiTheme.textFontSize font.kerning: true @@ -298,7 +295,9 @@ Rectangle { MaterialLineEdit { id: usernameSIP - fieldLayoutWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth font.pointSize: JamiTheme.settingsFontSize // Albert: buttonSize? font.kerning: true @@ -306,10 +305,6 @@ Rectangle { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight padding: 8 onEditingFinished: { @@ -333,7 +328,9 @@ Rectangle { MaterialLineEdit { id: hostnameSIP - fieldLayoutWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth font.pointSize: JamiTheme.settingsFontSize font.kerning: true @@ -341,10 +338,6 @@ Rectangle { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight padding: 8 onEditingFinished: { @@ -368,7 +361,9 @@ Rectangle { MaterialLineEdit { id: proxySIP - fieldLayoutWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth font.pointSize: JamiTheme.settingsFontSize // Albert font.kerning: true @@ -376,10 +371,6 @@ Rectangle { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight padding: 8 onEditingFinished: { @@ -403,7 +394,9 @@ Rectangle { MaterialLineEdit { id: passSIPlineEdit - fieldLayoutWidth: preferredColumnWidth + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: JamiTheme.preferredFieldHeight + Layout.preferredWidth: preferredColumnWidth font.pointSize: JamiTheme.settingsFontSize font.kerning: true @@ -412,10 +405,6 @@ Rectangle { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.maximumWidth: preferredColumnWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight padding: 8 onEditingFinished: { @@ -427,18 +416,13 @@ Rectangle { MaterialButton { - color: JamiTheme.buttonTintedRed - hoveredColor: JamiTheme.buttonTintedRedHovered - pressedColor: JamiTheme.buttonTintedRedPressed - Layout.alignment: Qt.AlignHCenter - - Layout.minimumWidth: JamiTheme.preferredFieldWidth Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.maximumWidth: JamiTheme.preferredFieldWidth - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight + + color: JamiTheme.buttonTintedRed + hoveredColor: JamiTheme.buttonTintedRedHovered + pressedColor: JamiTheme.buttonTintedRedPressed toolTipText: qsTr("Press this button to delete this account") text: qsTr("Delete Account") diff --git a/src/settingsview/components/GeneralSettingsPage.qml b/src/settingsview/components/GeneralSettingsPage.qml index 2b36cad1a64f688913bb56305bae3646d2f0ccd7..906b419e65d21703a15999e11751f4bf29f47cb4 100644 --- a/src/settingsview/components/GeneralSettingsPage.qml +++ b/src/settingsview/components/GeneralSettingsPage.qml @@ -351,15 +351,9 @@ Rectangle { MaterialButton { id: downloadButton - Layout.maximumWidth: preferredColumnWidth + Layout.alignment: Qt.AlignRight Layout.preferredWidth: preferredColumnWidth - Layout.minimumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - - Layout.alignment: Qt.AlignRight toolTipText: qsTr("Press to choose download folder path") text: downloadPath @@ -518,15 +512,9 @@ Rectangle { MaterialButton { id: recordPathButton - Layout.maximumWidth: preferredColumnWidth + Layout.alignment: Qt.AlignRight Layout.preferredWidth: preferredColumnWidth - Layout.minimumWidth: preferredColumnWidth - - Layout.minimumHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.maximumHeight: JamiTheme.preferredFieldHeight - - Layout.alignment: Qt.AlignRight toolTipText: qsTr("Press to choose record folder path") text: recordPath diff --git a/src/settingsview/components/PluginListSettingsView.qml b/src/settingsview/components/PluginListSettingsView.qml index 9b714c3d27d36233e44ea53432c43886fd0b11fb..389ab4f8ba7e4dfc818fa426280e1f70f873a7f9 100644 --- a/src/settingsview/components/PluginListSettingsView.qml +++ b/src/settingsview/components/PluginListSettingsView.qml @@ -121,8 +121,11 @@ Rectangle { MaterialButton { id: installButton - Layout.fillWidth: false - color: JamiTheme.buttonTintedBlack + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + + color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered pressedColor: JamiTheme.buttonTintedBlackPressed outlined: true diff --git a/src/wizardview/WizardView.qml b/src/wizardview/WizardView.qml index 653f5ef3dfa62d0190050cf0ccebf46aea37b563..f775e352b9ae598531c134a2b3aa9f3f28ab94bd 100644 --- a/src/wizardview/WizardView.qml +++ b/src/wizardview/WizardView.qml @@ -30,7 +30,7 @@ import "../constant" import "components" Rectangle { - id: wizardViewWindow + id: root enum Mode { CREATE, @@ -48,6 +48,8 @@ Rectangle { SEARCHING } + readonly property int layoutSpacing: 12 + property int textFontSize: 9 property int wizardMode: WizardView.CREATE property int addedAccountIndex: -1 @@ -66,8 +68,6 @@ Rectangle { signal wizardViewIsClosed visible: true - anchors.fill: parent - Component.onCompleted: { changePageQML(controlPanelStackView.welcomePageStackId) @@ -148,9 +148,6 @@ Rectangle { registeredNameFoundConnection.enabled = true } else if (pageIndex == controlPanelStackView.createSIPAccountPageId) { createSIPAccountPage.initializeOnShowUp() - btnNext.enabled = true - // start photo booth - createSIPAccountPage.startBooth() } else if (pageIndex == controlPanelStackView.importFromDevicePageId) { importFromDevicePage.initializeOnShowUp() } else if (pageIndex == controlPanelStackView.spinnerPageId) { @@ -158,11 +155,9 @@ Rectangle { createAccountPage.isToSetPassword_checkState_choosePasswordCheckBox = false } else if (pageIndex == controlPanelStackView.connectToAccountManagerPageId) { connectToAccountManagerPage.initializeOnShowUp() - btnNext.enabled = false } else if (pageIndex == controlPanelStackView.importFromBackupPageId) { importFromBackupPage.clearAllTextFields() fileToImport = "" - btnNext.enabled = false } else if (pageIndex == controlPanelStackView.profilePageId) { profilePage.initializeOnShowUp() profilePage.showBottom = showBottom @@ -203,235 +198,230 @@ Rectangle { onClicked: forceActiveFocus() } - ScrollView { - id: frame - clip: true + StackLayout { + id: controlPanelStackView + anchors.fill: parent - StackLayout { - id: controlPanelStackView - currentIndex: welcomePageStackId - height: wizardView.height - width: wizardView.width - - property int welcomePageStackId: 0 - property int createAccountPageId: 1 - property int createSIPAccountPageId: 2 - property int importFromBackupPageId: 3 - property int backupKeysPageId: 4 - property int importFromDevicePageId: 5 - property int connectToAccountManagerPageId: 6 - property int spinnerPageId: 7 - property int profilePageId: 8 - - WelcomePageLayout { - // welcome page, index 0 - id: welcomePage - - onWelcomePageRedirectPage: { - changePageQML(toPageIndex) - } + currentIndex: welcomePageStackId - onLeavePage: { - wizardViewIsClosed() - } + property int welcomePageStackId: 0 + property int createAccountPageId: 1 + property int createSIPAccountPageId: 2 + property int importFromBackupPageId: 3 + property int backupKeysPageId: 4 + property int importFromDevicePageId: 5 + property int connectToAccountManagerPageId: 6 + property int spinnerPageId: 7 + property int profilePageId: 8 + + WelcomePage { + // welcome page, index 0 + id: welcomePage + + onWelcomePageRedirectPage: { + changePageQML(toPageIndex) } - CreateAccountPage { - // create account page, index 1 - id: createAccountPage - - onCreateAccount: { - inputParaObject = {} - inputParaObject["password"] = text_passwordEditAlias - ClientWrapper.accountAdaptor.createJamiAccount( - createAccountPage.text_usernameEditAlias, - inputParaObject, - createAccountPage.boothImgBase64, - true) - showBackUp = true - showBottom = true - changePageQML(controlPanelStackView.profilePageId) - } + onLeavePage: { + wizardViewIsClosed() + } + } - onText_usernameEditAliasChanged: { - lookupTimer.restart() - } + CreateAccountPage { + // create account page, index 1 + id: createAccountPage + + onCreateAccount: { + inputParaObject = {} + inputParaObject["password"] = text_passwordEditAlias + ClientWrapper.accountAdaptor.createJamiAccount( + createAccountPage.text_usernameEditAlias, + inputParaObject, + createAccountPage.boothImgBase64, + true) + showBackUp = true + showBottom = true + changePageQML(controlPanelStackView.profilePageId) + } - onLeavePage: { - changePageQML(controlPanelStackView.welcomePageStackId) - } + onText_usernameEditAliasChanged: { + lookupTimer.restart() + } + + onLeavePage: { + changePageQML(controlPanelStackView.welcomePageStackId) + } - Timer { - id: lookupTimer + Timer { + id: lookupTimer - repeat: false - triggeredOnStart: false - interval: 200 + repeat: false + triggeredOnStart: false + interval: 200 - onTriggered: { - registeredName = createAccountPage.text_usernameEditAlias - if (registeredName.length !== 0) { - createAccountPage.nameRegistrationUIState = WizardView.SEARCHING - ClientWrapper.nameDirectory.lookupName("", registeredName) - } else { - createAccountPage.nameRegistrationUIState = WizardView.BLANK - } + onTriggered: { + registeredName = createAccountPage.text_usernameEditAlias + if (registeredName.length !== 0) { + createAccountPage.nameRegistrationUIState = WizardView.SEARCHING + ClientWrapper.nameDirectory.lookupName("", registeredName) + } else { + createAccountPage.nameRegistrationUIState = WizardView.BLANK } } } + } - CreateSIPAccountPage { - // create SIP account page, index 2 - id: createSIPAccountPage + CreateSIPAccountPage { + // create SIP account page, index 2 + id: createSIPAccountPage - onLeavePage: { - changePageQML(controlPanelStackView.welcomePageStackId) - } + onLeavePage: { + changePageQML(controlPanelStackView.welcomePageStackId) + } - onCreateAccount: { - inputParaObject = {} - inputParaObject["hostname"] = createSIPAccountPage.text_sipServernameEditAlias - inputParaObject["username"] = createSIPAccountPage.text_sipUsernameEditAlias - inputParaObject["password"] = createSIPAccountPage.text_sipPasswordEditAlias - inputParaObject["proxy"] = createSIPAccountPage.text_sipProxyEditAlias - createSIPAccountPage.clearAllTextFields() - - ClientWrapper.accountAdaptor.createSIPAccount(inputParaObject, "") - showBackUp = false - showBottom = false - changePageQML(controlPanelStackView.profilePageId) - controlPanelStackView.profilePage.readyToSaveDetails = true - } + onCreateAccount: { + inputParaObject = {} + inputParaObject["hostname"] = createSIPAccountPage.text_sipServernameEditAlias + inputParaObject["username"] = createSIPAccountPage.text_sipUsernameEditAlias + inputParaObject["password"] = createSIPAccountPage.text_sipPasswordEditAlias + inputParaObject["proxy"] = createSIPAccountPage.text_sipProxyEditAlias + createSIPAccountPage.clearAllTextFields() + + ClientWrapper.accountAdaptor.createSIPAccount(inputParaObject, "") + showBackUp = false + showBottom = false + changePageQML(controlPanelStackView.profilePageId) + controlPanelStackView.profilePage.readyToSaveDetails = true } + } - ImportFromBackupPage { - // import from backup page, index 3 - id: importFromBackupPage + ImportFromBackupPage { + // import from backup page, index 3 + id: importFromBackupPage - onLeavePage: { - changePageQML(controlPanelStackView.welcomePageStackId) - } + onLeavePage: { + changePageQML(controlPanelStackView.welcomePageStackId) + } - onImportAccount: { - inputParaObject = {} - inputParaObject["archivePath"] = ClientWrapper.utilsAdaptor.getAbsPath(importFromBackupPage.filePath) - inputParaObject["password"] = importFromBackupPage.text_passwordFromBackupEditAlias - importFromBackupPage.clearAllTextFields() - showBackUp = false - showBottom = false - showProfile = true - ClientWrapper.accountAdaptor.createJamiAccount( - "", inputParaObject, "", false) - } + onImportAccount: { + inputParaObject = {} + inputParaObject["archivePath"] = ClientWrapper.utilsAdaptor.getAbsPath(importFromBackupPage.filePath) + inputParaObject["password"] = importFromBackupPage.text_passwordFromBackupEditAlias + importFromBackupPage.clearAllTextFields() + showBackUp = false + showBottom = false + showProfile = true + ClientWrapper.accountAdaptor.createJamiAccount( + "", inputParaObject, "", false) } + } - BackupKeyPage { - // backup keys page, index 4 - id: backupKeysPage + BackupKeyPage { + // backup keys page, index 4 + id: backupKeysPage - onNeverShowAgainBoxClicked: { - SettingsAdapter.setValue(Settings.NeverShowMeAgain, isChecked) - } + onNeverShowAgainBoxClicked: { + SettingsAdapter.setValue(Settings.NeverShowMeAgain, isChecked) + } - onExport_Btn_FileDialogAccepted: { - if (accepted) { - // is there password? If so, go to password dialog, else, go to following directly - if (ClientWrapper.accountAdaptor.hasPassword()) { - passwordDialog.path = ClientWrapper.utilsAdaptor.getAbsPath(folderDir) - passwordDialog.open() - return - } else { - if (folderDir.length > 0) { - ClientWrapper.accountAdaptor.exportToFile( - ClientWrapper.utilsAdaptor.getCurrAccId(), - ClientWrapper.utilsAdaptor.getAbsPath(folderDir)) - } - } + onExport_Btn_FileDialogAccepted: { + if (accepted) { + // is there password? If so, go to password dialog, else, go to following directly + if (ClientWrapper.accountAdaptor.hasPassword()) { + passwordDialog.path = ClientWrapper.utilsAdaptor.getAbsPath(folderDir) + passwordDialog.open() + return + } else { + if (folderDir.length > 0) { + ClientWrapper.accountAdaptor.exportToFile( + ClientWrapper.utilsAdaptor.getCurrAccId(), + ClientWrapper.utilsAdaptor.getAbsPath(folderDir)) } - - changePageQML(controlPanelStackView.welcomePageStackId) - needToShowMainViewWindow(addedAccountIndex) - ClientWrapper.lrcInstance.accountListChanged() } + } - onLeavePage: { - changePageQML(controlPanelStackView.welcomePageStackId) - needToShowMainViewWindow(addedAccountIndex) - ClientWrapper.lrcInstance.accountListChanged() - } + changePageQML(controlPanelStackView.welcomePageStackId) + needToShowMainViewWindow(addedAccountIndex) + ClientWrapper.lrcInstance.accountListChanged() } - ImportFromDevicePage { - // import from device page, index 5 - id: importFromDevicePage - - onLeavePage: { - changePageQML(controlPanelStackView.welcomePageStackId) - } + onLeavePage: { + changePageQML(controlPanelStackView.welcomePageStackId) + needToShowMainViewWindow(addedAccountIndex) + ClientWrapper.lrcInstance.accountListChanged() + } + } - onImportAccount: { - inputParaObject = {} - inputParaObject["archivePin"] = importFromDevicePage.text_pinFromDeviceAlias - inputParaObject["password"] = importFromDevicePage.text_passwordFromDeviceAlias + ImportFromDevicePage { + // import from device page, index 5 + id: importFromDevicePage - showProfile = true - showBackUp = false - showBottom = false - ClientWrapper.accountAdaptor.createJamiAccount( - "", inputParaObject, "", false) - } + onLeavePage: { + changePageQML(controlPanelStackView.welcomePageStackId) } - ConnectToAccountManagerPage { - // connect to account manager Page, index 6 - id: connectToAccountManagerPage - - onCreateAccount: { - inputParaObject = {} - inputParaObject["username"] - = connectToAccountManagerPage.text_usernameManagerEditAlias - inputParaObject["password"] - = connectToAccountManagerPage.text_passwordManagerEditAlias - inputParaObject["manager"] - = connectToAccountManagerPage.text_accountManagerEditAlias - ClientWrapper.accountAdaptor.createJAMSAccount(inputParaObject) - } + onImportAccount: { + inputParaObject = {} + inputParaObject["archivePin"] = importFromDevicePage.text_pinFromDeviceAlias + inputParaObject["password"] = importFromDevicePage.text_passwordFromDeviceAlias - onLeavePage: { - changePageQML(controlPanelStackView.welcomePageStackId) - } + showProfile = true + showBackUp = false + showBottom = false + ClientWrapper.accountAdaptor.createJamiAccount( + "", inputParaObject, "", false) } + } - SpinnerPage { - // spinner Page, index 7 - id: spinnerPage + ConnectToAccountManagerPage { + // connect to account manager Page, index 6 + id: connectToAccountManagerPage + + onCreateAccount: { + inputParaObject = {} + inputParaObject["username"] + = connectToAccountManagerPage.text_usernameManagerEditAlias + inputParaObject["password"] + = connectToAccountManagerPage.text_passwordManagerEditAlias + inputParaObject["manager"] + = connectToAccountManagerPage.text_accountManagerEditAlias + ClientWrapper.accountAdaptor.createJAMSAccount(inputParaObject) } - ProfilePage { - // profile Page, index 8 - id: profilePage - - function leave() { - if (showBackUp) - changePageQML(controlPanelStackView.backupKeysPageId) - else { - changePageQML(controlPanelStackView.welcomePageStackId) - needToShowMainViewWindow(addedAccountIndex) - ClientWrapper.lrcInstance.accountListChanged() - } - } + onLeavePage: { + changePageQML(controlPanelStackView.welcomePageStackId) + } + } - onSaveProfile: { - SettingsAdapter.setCurrAccAvatar(profilePage.boothImgBase64) - ClientWrapper.accountAdaptor.setCurrAccDisplayName(profilePage.displayName) - leave() - } + SpinnerPage { + // spinner Page, index 7 + id: spinnerPage + } - onLeavePage: { - leave() + ProfilePage { + // profile Page, index 8 + id: profilePage + + function leave() { + if (showBackUp) + changePageQML(controlPanelStackView.backupKeysPageId) + else { + changePageQML(controlPanelStackView.welcomePageStackId) + needToShowMainViewWindow(addedAccountIndex) + ClientWrapper.lrcInstance.accountListChanged() } } + + onSaveProfile: { + SettingsAdapter.setCurrAccAvatar(profilePage.boothImgBase64) + ClientWrapper.accountAdaptor.setCurrAccDisplayName(profilePage.displayName) + leave() + } + + onLeavePage: { + leave() + } } } diff --git a/src/wizardview/components/AccountCreationStepIndicator.qml b/src/wizardview/components/AccountCreationStepIndicator.qml new file mode 100644 index 0000000000000000000000000000000000000000..5069e1c376cd865123d28e6279161518e9f2d8c4 --- /dev/null +++ b/src/wizardview/components/AccountCreationStepIndicator.qml @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2020 by Savoir-faire Linux + * Author: Mingrui Zhang <mingrui.zhang@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.Layouts 1.3 +import QtQuick.Controls 2.14 + +import "../../constant" +import "../../commoncomponents" + +Row { + id: root + + property int steps: 0 + property int currentStep: 0 + + Repeater { + model: steps + + Rectangle { + color: { + if (modelData === currentStep - 1) + return JamiTheme.accountCreationCurrentStepColor + return JamiTheme.accountCreationOtherStepColor + } + radius: height / 2 + implicitHeight: 12 + implicitWidth: 12 + } + } +} diff --git a/src/wizardview/components/BackupKeyPage.qml b/src/wizardview/components/BackupKeyPage.qml index de1b3177cf33f39f849393ec4f97c898ac5c72ed..6245c44f29ed085ba389d7910728efa7631e592d 100644 --- a/src/wizardview/components/BackupKeyPage.qml +++ b/src/wizardview/components/BackupKeyPage.qml @@ -61,36 +61,31 @@ Rectangle { } } - anchors.fill: parent - color: JamiTheme.backgroundColor ColumnLayout { - spacing: 12 + spacing: layoutSpacing anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - Layout.preferredWidth: backupBtn.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter RowLayout { - spacing: 12 - height: 48 + spacing: layoutSpacing - anchors.left: backupBtn.left - anchors.right: backupBtn.right + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: backupBtn.width Label { text: qsTr("Backup your account!") - font.pointSize: JamiTheme.textFontSize + 3 } Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Recommended") color: "white" padding: 8 - anchors.right: parent.right background: Rectangle { color: "#aed581" @@ -101,24 +96,33 @@ Rectangle { } Label { - text: qsTr("This account only exists on this device. If you lost your device or uninstall the application, your account will be deleted. You can backup your account now or later.") - wrapMode: Text.Wrap - anchors.left: backupBtn.left - anchors.right: backupBtn.right + property int preferredHeight: 0 + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: backupBtn.width + Layout.preferredHeight: preferredHeight + text: qsTr("This account only exists on this device. " + + "If you lost your device or uninstall the application, " + + "your account will be deleted. " + + "You can backup your account now or later.") + wrapMode: Text.WordWrap font.pointSize: JamiTheme.textFontSize + + onFontChanged: { + var boundingRect = JamiQmlUtils.getTextBoundingRect(font, text) + preferredHeight = (boundingRect.width / backupBtn.preferredWidth) + * boundingRect.height + } } RowLayout { - spacing: 12 - height: 48 + spacing: layoutSpacing - anchors.right: backupBtn.right - anchors.left: backupBtn.left + Layout.alignment: Qt.AlignCenter Label { text: qsTr("Never show me this again") - font.pointSize: JamiTheme.textFontSize } @@ -134,6 +138,11 @@ Rectangle { MaterialButton { id: backupBtn + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("BACKUP ACCOUNT") color: JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedGreyHovered @@ -146,6 +155,10 @@ Rectangle { } MaterialButton { + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("SKIP") color: JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedGreyHovered @@ -157,41 +170,4 @@ Rectangle { } } } - - HoverableButton { - id: cancelButton - z: 2 - - anchors.right: parent.right - anchors.top: parent.top - - rightPadding: 90 - topPadding: 90 - - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" - - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Close") - - Action { - enabled: parent.visible - shortcut: StandardKey.Cancel - onTriggered: leavePage() - } - - onClicked: { - leavePage() - } - } } diff --git a/src/wizardview/components/ConnectToAccountManagerPage.qml b/src/wizardview/components/ConnectToAccountManagerPage.qml index 356171ae772722d8f82e34bed798b8bb3780ff08..7576b93227de5c4575f36c12449b241d63a54d00 100644 --- a/src/wizardview/components/ConnectToAccountManagerPage.qml +++ b/src/wizardview/components/ConnectToAccountManagerPage.qml @@ -42,38 +42,34 @@ Rectangle { errorText = "" } - anchors.fill: parent - color: JamiTheme.backgroundColor signal leavePage signal createAccount ColumnLayout { - spacing: 12 + spacing: layoutSpacing anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - Layout.preferredWidth: parent.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter RowLayout { - spacing: 12 - height: 48 + spacing: layoutSpacing - Layout.fillWidth: true - anchors.left: connectBtn.left - anchors.right: connectBtn.right + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: connectBtn.width Label { text: qsTr("Enter URL of management server") + font.pointSize: JamiTheme.textFontSize + 3 } Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Required") color: "#ff1f62" padding: 8 - anchors.right: parent.right background: Rectangle { color: "#fee4e9" @@ -86,19 +82,20 @@ Rectangle { MaterialLineEdit { id: accountManagerEdit + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: connectBtn.width + Layout.alignment: Qt.AlignCenter + selectByMouse: true placeholderText: qsTr("Jami management server URL") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true borderColorMode: MaterialLineEdit.NORMAL - - fieldLayoutWidth: connectBtn.width } - Text { - anchors.left: connectBtn.left - anchors.right: connectBtn.right + Label { + Layout.alignment: Qt.AlignLeft text: qsTr("Enter your organization credentials") wrapMode: Text.Wrap @@ -107,33 +104,42 @@ Rectangle { MaterialLineEdit { id: usernameManagerEdit + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: connectBtn.width + Layout.alignment: Qt.AlignCenter + selectByMouse: true placeholderText: qsTr("Username") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true borderColorMode: MaterialLineEdit.NORMAL - - fieldLayoutWidth: connectBtn.width } MaterialLineEdit { id: passwordManagerEdit + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: connectBtn.width + Layout.alignment: Qt.AlignCenter + selectByMouse: true placeholderText: qsTr("Password") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true echoMode: TextInput.Password borderColorMode: MaterialLineEdit.NORMAL - - fieldLayoutWidth: connectBtn.width } MaterialButton { id: connectBtn + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("CONNECT") enabled: accountManagerEdit.text.length !== 0 && usernameManagerEdit.text.length !== 0 @@ -149,53 +155,29 @@ Rectangle { } Label { - text: errorText + Layout.alignment: Qt.AlignCenter - anchors.left: connectBtn.left - anchors.right: connectBtn.right - Layout.alignment: Qt.AlignHCenter + visible: errorText.length !== 0 + text: errorText font.pointSize: JamiTheme.textFontSize color: "red" - - height: 32 } - } - - HoverableButton { - id: cancelButton - z: 2 - anchors.right: parent.right - anchors.top: parent.top - - rightPadding: 90 - topPadding: 90 - - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" + MaterialButton { + id: backButton - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Return to welcome page") + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight - Action { - enabled: parent.visible - shortcut: StandardKey.Cancel - onTriggered: leavePage() - } + text: qsTr("BACK") + color: JamiTheme.buttonTintedGrey + hoveredColor: JamiTheme.buttonTintedGreyHovered + pressedColor: JamiTheme.buttonTintedGreyPressed + outlined: true - onClicked: { - leavePage() + onClicked: leavePage() } } } diff --git a/src/wizardview/components/CreateAccountPage.qml b/src/wizardview/components/CreateAccountPage.qml index c3cc19bef374dd7c51f351f8d90d355c3d40a90a..d10469fd1c2312e03bacbc1ec2af5ae93571fc88 100644 --- a/src/wizardview/components/CreateAccountPage.qml +++ b/src/wizardview/components/CreateAccountPage.qml @@ -48,10 +48,15 @@ Rectangle { passwordConfirmEdit.clear() } - anchors.fill: parent - color: JamiTheme.backgroundColor + Shortcut { + context: Qt.ApplicationShortcut + sequence: "Esc" + enabled: !root.activeFocus + onActivated: leavePage() + } + /* * JamiFileDialog for exporting account */ @@ -83,32 +88,33 @@ Rectangle { StackLayout { id: createAccountStack + anchors.verticalCenter: root.verticalCenter anchors.horizontalCenter: root.horizontalCenter ColumnLayout { - spacing: 12 + spacing: layoutSpacing - anchors.verticalCenter: parent.verticalCenter Layout.preferredWidth: root.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + Layout.alignment: Qt.AlignCenter RowLayout { - spacing: 12 - height: 48 + spacing: layoutSpacing - Layout.fillWidth: true - anchors.left: usernameEdit.left + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: usernameEdit.width Label { - text: qsTr("Choose a username for your account") + text: qsTr("Choose a username") + font.pointSize: JamiTheme.textFontSize + 3 } Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Recommended") color: "white" padding: 8 - anchors.right: parent.right background: Rectangle { color: "#aed581" @@ -121,19 +127,32 @@ Rectangle { MaterialLineEdit { id: usernameEdit + Layout.topMargin: 15 + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: fieldLayoutWidth + Layout.alignment: Qt.AlignHCenter + selectByMouse: true placeholderText: qsTr("Choose your username") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true - borderColorMode: nameRegistrationUIState === WizardView.BLANK ? MaterialLineEdit.NORMAL - : nameRegistrationUIState >= WizardView.FREE ? MaterialLineEdit.NORMAL : MaterialLineEdit.ERROR + borderColorMode: { + if (nameRegistrationUIState === WizardView.BLANK) + return MaterialLineEdit.NORMAL + else + return nameRegistrationUIState >= WizardView.FREE ? + MaterialLineEdit.NORMAL : MaterialLineEdit.ERROR + } fieldLayoutWidth: chooseUsernameButton.width - Layout.topMargin: 32 } Label { + Layout.alignment: Qt.AlignHCenter + + visible: text.length !==0 + text: { switch(nameRegistrationUIState){ case WizardView.BLANK: @@ -146,19 +165,17 @@ Rectangle { return qsTr("Username already taken") } } - - anchors.left: usernameEdit.left - anchors.right: usernameEdit.right - Layout.alignment: Qt.AlignHCenter - font.pointSize: JamiTheme.textFontSize color: "red" - - height: 32 } MaterialButton { id: chooseUsernameButton + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("CHOOSE USERNAME") color: nameRegistrationUIState === WizardView.FREE? JamiTheme.buttonTintedGrey @@ -172,43 +189,70 @@ Rectangle { } } - MaterialButton { - text: qsTr("SKIP CHOOSING USERNAME") - color: JamiTheme.buttonTintedGrey - hoveredColor: JamiTheme.buttonTintedGreyHovered - pressedColor: JamiTheme.buttonTintedGreyPressed - outlined: true + Row { + id: skipAndBackButtonsRow - onClicked: { - createAccountStack.currentIndex = createAccountStack.currentIndex + 1 + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: chooseUsernameButton.preferredWidth + Layout.preferredHeight: chooseUsernameButton.preferredHeight + + spacing: layoutSpacing + + Repeater { + model: 2 + + MaterialButton { + width: (skipAndBackButtonsRow.width - + skipAndBackButtonsRow.spacing) / 2 + height: skipAndBackButtonsRow.height + + text: modelData === 0 ? qsTr("BACK") : qsTr("SKIP") + color: JamiTheme.buttonTintedGrey + hoveredColor: JamiTheme.buttonTintedGreyHovered + pressedColor: JamiTheme.buttonTintedGreyPressed + outlined: true + + onClicked: { + if (modelData === 0) + leavePage() + else + createAccountStack.currentIndex = + createAccountStack.currentIndex + 1 + } + } } } } ColumnLayout { - spacing: 12 + spacing: layoutSpacing - anchors.verticalCenter: parent.verticalCenter Layout.preferredWidth: root.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + Layout.alignment: Qt.AlignCenter RowLayout { - spacing: 12 - height: 48 + spacing: layoutSpacing - anchors.right: createAccountButton.right - anchors.left: createAccountButton.left + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: usernameEdit.width Label { - text: qsTr("Encrypt account with password") - + text: qsTr("Create a password") font.pointSize: JamiTheme.textFontSize + 3 + + Switch { + id: passwordSwitch + + anchors.left: parent.right + anchors.verticalCenter: parent.verticalCenter + } } Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Optional") color: "white" - anchors.right: parent.right padding: 8 background: Rectangle { @@ -219,147 +263,99 @@ Rectangle { } } - RowLayout { - spacing: 12 - height: 48 - - anchors.right: createAccountButton.right - anchors.left: createAccountButton.left - - Label { - text: qsTr("Choose a password to encrypt the account key on this device") - - font.pointSize: JamiTheme.textFontSize - } - - Switch { - id: passwordSwitch - Layout.alignment: Qt.AlignRight - } - } - MaterialLineEdit { id: passwordEdit - visible: passwordSwitch.checked - - fieldLayoutWidth: createAccountButton.width - + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: createAccountButton.width Layout.alignment: Qt.AlignHCenter + visible: passwordSwitch.checked + selectByMouse: true echoMode: TextInput.Password placeholderText: qsTr("Password") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true } MaterialLineEdit { id: passwordConfirmEdit - visible: passwordSwitch.checked - - fieldLayoutWidth: createAccountButton.width - + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: createAccountButton.width Layout.alignment: Qt.AlignHCenter + visible: passwordSwitch.checked + selectByMouse: true echoMode: TextInput.Password placeholderText: qsTr("Confirm password") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true } Label { - anchors.right: createAccountButton.right - anchors.left: createAccountButton.left + Layout.alignment: Qt.AlignLeft + Layout.topMargin: 10 + Layout.leftMargin: (root.width - createAccountButton.width) / 2 text: qsTr("Note that the password cannot be recovered") - font.pointSize: JamiTheme.textFontSize } MaterialButton { id: createAccountButton + + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 10 + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + + function checkEnable() { + return !passwordSwitch.checked || + (passwordEdit.text === passwordConfirmEdit.text + && passwordEdit.text.length !== 0) + } + text: qsTr("CREATE ACCOUNT") - color: !passwordSwitch.checked || - (passwordEdit.text === passwordConfirmEdit.text && passwordEdit.text.length !== 0)? - JamiTheme.wizardBlueButtons : JamiTheme.buttonTintedGreyInactive + enabled: checkEnable() + color: checkEnable() ? JamiTheme.wizardBlueButtons : + JamiTheme.buttonTintedGreyInactive hoveredColor: JamiTheme.buttonTintedBlueHovered pressedColor: JamiTheme.buttonTintedBluePressed onClicked: { createAccount() - createAccountStack.currentIndex = createAccountStack.currentIndex + 1 + createAccountStack.currentIndex += 1 } } - } - } - - RowLayout { - spacing: 12 - height: 48 - anchors.top: createAccountStack.bottom - anchors.horizontalCenter: root.horizontalCenter - Layout.alignment: Qt.AlignHCenter + MaterialButton { + id: backButton - Rectangle { - color: usernameEdit.visible? JamiTheme.wizardBlueButtons : "grey" - radius: height / 2 - height: 12 - width: 12 - } + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight - Rectangle { - color: createAccountButton.visible? JamiTheme.wizardBlueButtons : "grey" - radius: height / 2 - height: 12 - width: 12 - } + text: qsTr("BACK") + color: JamiTheme.buttonTintedGrey + hoveredColor: JamiTheme.buttonTintedGreyHovered + pressedColor: JamiTheme.buttonTintedGreyPressed + outlined: true - Rectangle { - color: "grey" - radius: height / 2 - height: 12 - width: 12 + onClicked: createAccountStack.currentIndex -= 1 + } } } - HoverableButton { - id: cancelButton - z: 2 - - anchors.right: parent.right - anchors.top: parent.top - - rightPadding: 90 - topPadding: 90 - - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" - - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Return to welcome page") - - Shortcut { - sequence: StandardKey.Cancel - enabled: parent.visible - onActivated: leavePage() - } + AccountCreationStepIndicator { + anchors.bottom: root.bottom + anchors.bottomMargin: 30 + anchors.horizontalCenter: root.horizontalCenter - onClicked: { - leavePage() - } + spacing: layoutSpacing + steps: 3 + currentStep: usernameEdit.visible ? 1 : 2 } } diff --git a/src/wizardview/components/CreateSIPAccountPage.qml b/src/wizardview/components/CreateSIPAccountPage.qml index 13afb814cf5d0ad154c83f29ee344269ba92833a..d0f02390a856c8d4a4a37b2df7cd8ed8c679b69c 100644 --- a/src/wizardview/components/CreateSIPAccountPage.qml +++ b/src/wizardview/components/CreateSIPAccountPage.qml @@ -23,7 +23,6 @@ import QtQuick.Controls 2.14 import "../../constant" import "../../commoncomponents" - Rectangle { id: root @@ -32,7 +31,7 @@ Rectangle { property alias text_sipUsernameEditAlias: sipUsernameEdit.text property alias text_sipPasswordEditAlias: sipPasswordEdit.text - property /*alias*/ var boothImgBase64: null//setSIPAvatarWidget.imgBase64 + property var boothImgBase64: null function initializeOnShowUp() { clearAllTextFields() @@ -49,36 +48,33 @@ Rectangle { signal createAccount signal leavePage - anchors.fill: parent - color: JamiTheme.backgroundColor ColumnLayout { - spacing: 12 + spacing: layoutSpacing - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - Layout.preferredWidth: createAccountButton.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + anchors.centerIn: parent RowLayout { - spacing: 12 - height: 48 + spacing: layoutSpacing - anchors.left: createAccountButton.left - anchors.right: createAccountButton.right + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: createAccountButton.width Label { text: qsTr("Configure an existing SIP account") + font.pointSize: JamiTheme.textFontSize + 3 } Label { - text: qsTr("Required") - color: "#ff1f62" + Layout.alignment: Qt.AlignRight + + text: qsTr("Optional") + color: "white" padding: 8 background: Rectangle { - color: "#fee4e9" + color: "#28b1ed" radius: 24 anchors.fill: parent } @@ -88,58 +84,63 @@ Rectangle { MaterialLineEdit { id: sipServernameEdit - fieldLayoutWidth: createAccountButton.width - - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: createAccountButton.width selectByMouse: true placeholderText: qsTr("Server") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true } MaterialLineEdit { id: sipProxyEdit - fieldLayoutWidth: createAccountButton.width - - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: createAccountButton.width selectByMouse: true placeholderText: qsTr("Proxy") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true } MaterialLineEdit { id: sipUsernameEdit - fieldLayoutWidth: createAccountButton.width - - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: createAccountButton.width selectByMouse: true placeholderText: qsTr("Username") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true } MaterialLineEdit { id: sipPasswordEdit - fieldLayoutWidth: createAccountButton.width - - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: createAccountButton.width selectByMouse: true echoMode: TextInput.Password placeholderText: qsTr("Password") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true } MaterialButton { id: createAccountButton + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("CREATE SIP ACCOUNT") color: JamiTheme.wizardBlueButtons hoveredColor: JamiTheme.buttonTintedBlueHovered @@ -149,42 +150,21 @@ Rectangle { createAccount() } } - } - - HoverableButton { - id: cancelButton - z: 2 - - anchors.right: parent.right - anchors.top: parent.top - rightPadding: 90 - topPadding: 90 - - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" + MaterialButton { + id: backButton - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Return to welcome page") + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: createAccountButton.width / 2 + Layout.preferredHeight: preferredHeight - Action { - enabled: parent.visible - shortcut: StandardKey.Cancel - onTriggered: leavePage() - } + text: qsTr("BACK") + color: JamiTheme.buttonTintedGrey + hoveredColor: JamiTheme.buttonTintedGreyHovered + pressedColor: JamiTheme.buttonTintedGreyPressed + outlined: true - onClicked: { - leavePage() + onClicked: leavePage() } } } diff --git a/src/wizardview/components/ImportFromBackupPage.qml b/src/wizardview/components/ImportFromBackupPage.qml index 9d57224964336ceaf7efccbf1cb1f77be1e71ddb..98f5827080e86c2b42d0eeb35549aa7c232e33ff 100644 --- a/src/wizardview/components/ImportFromBackupPage.qml +++ b/src/wizardview/components/ImportFromBackupPage.qml @@ -59,24 +59,19 @@ Rectangle { } } - anchors.fill: parent - color: JamiTheme.backgroundColor signal leavePage signal importAccount ColumnLayout { - spacing: 12 + spacing: layoutSpacing + anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: root.horizontalCenter - Layout.preferredWidth: parent.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Text { - anchors.left: connectBtn.left - anchors.right: connectBtn.right + Layout.alignment: Qt.AlignCenter text: qsTr("Import from backup") font.pointSize: JamiTheme.menuFontSize @@ -85,6 +80,10 @@ Rectangle { MaterialButton { id: fileImportBtn + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: fileImportBtnText toolTipText: qsTr("Import your account's archive") source: "qrc:/images/icons/round-folder-24px.svg" @@ -92,39 +91,58 @@ Rectangle { hoveredColor: JamiTheme.buttonTintedGreyHovered pressedColor: JamiTheme.buttonTintedGreyPressed - onClicked: { - importFromFile_Dialog.open() - } + onClicked: importFromFile_Dialog.open() } Text { - anchors.left: connectBtn.left - anchors.right: connectBtn.right + // For multiline text, recursive rearrange warning will show up when + // directly assigning contentHeight to Layout.preferredHeight + property int preferredHeight: layoutSpacing + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: fileImportBtn.width + Layout.preferredHeight: preferredHeight - text: qsTr("You can obtain an archive by clicking on \"Export account\" in the account settings. This will create a .gz file on your device.") + text: qsTr("You can obtain an archive by clicking on \"Export account\" " + + "in the account settings. " + + "This will create a .gz file on your device.") wrapMode: Text.Wrap + + onTextChanged: { + var boundingRect = JamiQmlUtils.getTextBoundingRect(font, text) + preferredHeight += (boundingRect.width / fileImportBtn.preferredWidth) + * boundingRect.height + } } MaterialLineEdit { id: passwordFromBackupEdit + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: connectBtn.width + Layout.alignment: Qt.AlignCenter + selectByMouse: true placeholderText: qsTr("Password") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true echoMode: TextInput.Password borderColorMode: MaterialLineEdit.NORMAL - - fieldLayoutWidth: connectBtn.width } MaterialButton { id: connectBtn + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("CONNECT FROM BACKUP") - color: filePath.length === 0? + color: filePath.length === 0 ? JamiTheme.buttonTintedGreyInactive : JamiTheme.buttonTintedGrey + enabled: !(filePath.length === 0) hoveredColor: JamiTheme.buttonTintedGreyHovered pressedColor: JamiTheme.buttonTintedGreyPressed @@ -135,53 +153,29 @@ Rectangle { } Label { - text: errorText + Layout.alignment: Qt.AlignCenter - anchors.left: connectBtn.left - anchors.right: connectBtn.right - Layout.alignment: Qt.AlignHCenter + visible: errorText.length !== 0 + text: errorText font.pointSize: JamiTheme.textFontSize color: "red" - - height: 32 } - } - - HoverableButton { - id: cancelButton - z: 2 - - anchors.right: parent.right - anchors.top: parent.top - - rightPadding: 90 - topPadding: 90 - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" + MaterialButton { + id: backButton - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Return to welcome page") + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: connectBtn.width / 2 + Layout.preferredHeight: preferredHeight - Action { - enabled: parent.visible - shortcut: StandardKey.Cancel - onTriggered: leavePage() - } + text: qsTr("BACK") + color: JamiTheme.buttonTintedGrey + hoveredColor: JamiTheme.buttonTintedGreyHovered + pressedColor: JamiTheme.buttonTintedGreyPressed + outlined: true - onClicked: { - leavePage() + onClicked: leavePage() } } } diff --git a/src/wizardview/components/ImportFromDevicePage.qml b/src/wizardview/components/ImportFromDevicePage.qml index afb2b70eb5f932ba1e833b8c104ae5977fc623fa..d4d786e66b09ead29016547414065cb11d046e2d 100644 --- a/src/wizardview/components/ImportFromDevicePage.qml +++ b/src/wizardview/components/ImportFromDevicePage.qml @@ -39,24 +39,20 @@ Rectangle { passwordFromDevice.clear() } - anchors.fill: parent - color: JamiTheme.backgroundColor signal leavePage signal importAccount ColumnLayout { - spacing: 12 + spacing: layoutSpacing + // Prevent possible anchor loop detected on centerIn. anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - Layout.preferredWidth: parent.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Text { - anchors.left: connectBtn.left - anchors.right: connectBtn.right + Layout.alignment: Qt.AlignCenter text: qsTr("Enter your main Jami account password") font.pointSize: JamiTheme.menuFontSize @@ -65,41 +61,60 @@ Rectangle { MaterialLineEdit { id: passwordFromDevice + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: connectBtn.width + Layout.alignment: Qt.AlignCenter + selectByMouse: true placeholderText: qsTr("Password") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true echoMode: TextInput.Password borderColorMode: MaterialLineEdit.NORMAL - - fieldLayoutWidth: connectBtn.width } Text { - anchors.left: connectBtn.left - anchors.right: connectBtn.right + property int preferredHeight: layoutSpacing - text: qsTr("Enter the PIN from another configured Jami account. Use the \"export Jami account\" feature to obtain a PIN") + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: connectBtn.width + Layout.preferredHeight: preferredHeight + + text: qsTr("Enter the PIN from another configured Jami account. " + + "Use the \"export Jami account\" feature to obtain a PIN") wrapMode: Text.Wrap + + onTextChanged: { + var boundingRect = JamiQmlUtils.getTextBoundingRect(font, text) + preferredHeight += (boundingRect.width / connectBtn.preferredWidth) + * boundingRect.height + } } MaterialLineEdit { id: pinFromDevice + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: connectBtn.width + Layout.alignment: Qt.AlignCenter + selectByMouse: true placeholderText: qsTr("PIN") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true borderColorMode: MaterialLineEdit.NORMAL - - fieldLayoutWidth: connectBtn.width } MaterialButton { id: connectBtn + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("CONNECT FROM ANOTHER DEVICE") color: pinFromDevice.text.length === 0? JamiTheme.buttonTintedGreyInactive : JamiTheme.buttonTintedGrey @@ -113,53 +128,30 @@ Rectangle { } Label { - text: errorText + Layout.alignment: Qt.AlignCenter - anchors.left: connectBtn.left - anchors.right: connectBtn.right - Layout.alignment: Qt.AlignHCenter + visible: errorText.length !== 0 + + text: errorText font.pointSize: JamiTheme.textFontSize color: "red" - - height: 32 } - } - - HoverableButton { - id: cancelButton - z: 2 - - anchors.right: parent.right - anchors.top: parent.top - - rightPadding: 90 - topPadding: 90 - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" + MaterialButton { + id: backButton - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Return to welcome page") + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: connectBtn.width / 2 + Layout.preferredHeight: preferredHeight - Shortcut { - sequence: StandardKey.Cancel - enabled: parent.visible - onActivated: leavePage() - } + text: qsTr("BACK") + color: JamiTheme.buttonTintedGrey + hoveredColor: JamiTheme.buttonTintedGreyHovered + pressedColor: JamiTheme.buttonTintedGreyPressed + outlined: true - onClicked: { - leavePage() + onClicked: leavePage() } } } diff --git a/src/wizardview/components/ProfilePage.qml b/src/wizardview/components/ProfilePage.qml index 794514f4e8dd15e2f35cf92335c4667e94c958c0..f1e64dda0a08d7e67648c13dfd1a784d89a07395 100644 --- a/src/wizardview/components/ProfilePage.qml +++ b/src/wizardview/components/ProfilePage.qml @@ -36,8 +36,6 @@ Rectangle { aliasEdit.clear() } - anchors.fill: parent - color: JamiTheme.backgroundColor signal leavePage @@ -49,30 +47,28 @@ Rectangle { property alias displayName: aliasEdit.text ColumnLayout { - spacing: 12 + spacing: layoutSpacing + width: parent.width anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - Layout.preferredWidth: parent.width - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - RowLayout { - spacing: 12 - height: 48 + spacing: layoutSpacing Layout.preferredWidth: saveProfileBtn.width + Layout.alignment: Qt.AlignCenter Label { text: qsTr("Profile is only shared with contacts") - font.pointSize: JamiTheme.textFontSize + 3 } Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Optional") color: "white" - Layout.alignment: Qt.AlignRight padding: 8 background: Rectangle { @@ -86,22 +82,23 @@ Rectangle { PhotoboothView { id: setAvatarWidget - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredWidth - Layout.maximumWidth: 256 - Layout.preferredWidth: 256 - Layout.minimumWidth: 256 - Layout.maximumHeight: 256 - Layout.preferredHeight: 256 - Layout.minimumHeight: 256 + boothWidth: 200 } MaterialLineEdit { id: aliasEdit + Layout.preferredHeight: fieldLayoutHeight + Layout.preferredWidth: fieldLayoutWidth + Layout.alignment: Qt.AlignCenter + selectByMouse: true placeholderText: qsTr("Enter your name") - font.pointSize: 10 + font.pointSize: 9 font.kerning: true borderColorMode: MaterialLineEdit.NORMAL @@ -111,6 +108,11 @@ Rectangle { MaterialButton { id: saveProfileBtn + + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + enabled: readyToSaveDetails text: enabled? qsTr("Save Profile") : qsTr("Generating account…") color: enabled? JamiTheme.wizardBlueButtons : JamiTheme.buttonTintedGreyInactive @@ -123,6 +125,10 @@ Rectangle { } MaterialButton { + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("SKIP") enabled: saveProfileBtn.enabled color: enabled? JamiTheme.buttonTintedGrey : JamiTheme.buttonTintedGreyInactive @@ -134,84 +140,15 @@ Rectangle { leavePage() } } - - RowLayout { - id: bottomLayout - height: 48 - spacing: 12 - visible: showBottom - - Layout.preferredWidth: saveProfileBtn.width - Layout.topMargin: 12 - Layout.alignment: Qt.AlignHCenter - - Item { - Layout.fillWidth: true - } - - Rectangle { - color: "grey" - radius: height / 2 - height: 12 - width: 12 - } - - Rectangle { - color: "grey" - radius: height / 2 - height: 12 - width: 12 - } - - Rectangle { - color: JamiTheme.wizardBlueButtons - radius: height / 2 - height: 12 - width: 12 - } - - Item { - Layout.fillWidth: true - } - } - } - HoverableButton { - id: cancelButton - z: 2 - visible: readyToSaveDetails - - anchors.right: parent.right - anchors.top: parent.top - - rightPadding: 90 - topPadding: 90 - - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" - - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Close") - - Action { - enabled: parent.visible - shortcut: StandardKey.Cancel - onTriggered: leavePage() - } + AccountCreationStepIndicator { + anchors.bottom: root.bottom + anchors.bottomMargin: 30 + anchors.horizontalCenter: root.horizontalCenter - onClicked: { - leavePage() - } + spacing: layoutSpacing + steps: 3 + currentStep: 3 } } diff --git a/src/wizardview/components/WelcomePageLayout.qml b/src/wizardview/components/WelcomePage.qml similarity index 64% rename from src/wizardview/components/WelcomePageLayout.qml rename to src/wizardview/components/WelcomePage.qml index 8023fd148e8968573bd8c81e0c7c281719d65985..f1ea2787f4ef18bc355a1723c5de4c8eeafa4298 100644 --- a/src/wizardview/components/WelcomePageLayout.qml +++ b/src/wizardview/components/WelcomePage.qml @@ -26,44 +26,38 @@ import net.jami.Models 1.0 import "../../constant" import "../../commoncomponents" -ColumnLayout { - anchors.fill: parent - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter +Rectangle { + id: root signal welcomePageRedirectPage(int toPageIndex) signal leavePage - Item { - // put a spacer to make the buttons closs to the middle - Layout.preferredHeight: 48 - Layout.fillWidth: true - Layout.fillHeight: true - } - RowLayout { - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - Label { + color: JamiTheme.backgroundColor + + ColumnLayout { + anchors.centerIn: parent + + Text { id: welcomeLabel - Layout.maximumHeight: 40 + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: contentHeight + text: qsTr("Welcome to") + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: 30 font.kerning: true } - } - RowLayout { - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter + Label { id: welcomeLogo + Layout.alignment: Qt.AlignCenter - Layout.minimumWidth: 100 - Layout.minimumHeight: 100 - Layout.maximumWidth: 16777215 - Layout.maximumHeight: 16777215 Layout.preferredWidth: 300 Layout.preferredHeight: 150 + color: "transparent" background: Image { id: logoIMG @@ -72,15 +66,15 @@ ColumnLayout { mipmap: true } } - } - RowLayout { - spacing: 8 - Layout.fillWidth: true - Layout.maximumHeight: 36 - Layout.alignment: Qt.AlignHCenter + MaterialButton { id: newAccountButton + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 8 + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("CREATE A JAMI ACCOUNT") toolTipText: qsTr("Create new Jami account") source: "qrc:/images/default_avatar_overlay.svg" @@ -92,16 +86,15 @@ ColumnLayout { welcomePageRedirectPage(1) } } - } - RowLayout { - spacing: 8 - Layout.fillWidth: true - Layout.maximumHeight: 36 - Layout.alignment: Qt.AlignHCenter MaterialButton { id: fromDeviceButton + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 8 + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("IMPORT FROM ANOTHER DEVICE") toolTipText: qsTr("Import account from other device") source: "qrc:/images/icons/devices-24px.svg" @@ -113,16 +106,15 @@ ColumnLayout { welcomePageRedirectPage(5) } } - } - RowLayout { - spacing: 8 - Layout.fillWidth: true - Layout.maximumHeight: 36 - Layout.alignment: Qt.AlignHCenter MaterialButton { id: fromBackupButton + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 8 + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("CONNECT FROM BACKUP") toolTipText: qsTr("Import account from backup file") source: "qrc:/images/icons/backup-24px.svg" @@ -134,16 +126,15 @@ ColumnLayout { welcomePageRedirectPage(3) } } - } - RowLayout { - spacing: 8 - Layout.fillWidth: true - Layout.maximumHeight: 36 - Layout.alignment: Qt.AlignHCenter MaterialButton { id: showAdvancedButton + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 8 + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + text: qsTr("SHOW ADVANCED") toolTipText: qsTr("Show advanced options") color: JamiTheme.buttonTintedBlue @@ -162,15 +153,15 @@ ColumnLayout { newSIPAccountButton.visible = !newSIPAccountButton.visible } } - } - RowLayout { - spacing: 8 - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - Layout.maximumHeight: 36 MaterialButton { id: connectAccountManagerButton + + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 8 + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + visible: false text: qsTr("CONNECT TO MANAGEMENT SERVER") @@ -184,14 +175,15 @@ ColumnLayout { welcomePageRedirectPage(6) } } - } - RowLayout { - spacing: 8 - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - Layout.maximumHeight: 36 + MaterialButton { id: newSIPAccountButton + + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 8 + Layout.preferredWidth: preferredWidth + Layout.preferredHeight: preferredHeight + visible: false text: qsTr("CREATE A SIP ACCOUNT") @@ -206,51 +198,4 @@ ColumnLayout { } } } - Item { - // put a spacer to make the buttons closs to the middle - Layout.fillHeight: true - Layout.preferredHeight: 65 - Layout.fillWidth: true - } - - HoverableButton { - id: cancelButton - z: 2 - - visible: { - return ClientWrapper.utilsAdaptor.getAccountListSize() > 0 - } - - anchors.right: parent.right - anchors.top: parent.top - - rightPadding: 40 - topPadding: 40 - - Layout.preferredWidth: 96 - Layout.preferredHeight: 96 - - backgroundColor: "transparent" - onEnterColor: "transparent" - onPressColor: "transparent" - onReleaseColor: "transparent" - onExitColor: "transparent" - - buttonImageHeight: 48 - buttonImageWidth: 48 - source: "qrc:/images/icons/ic_close_white_24dp.png" - radius: 48 - baseColor: "#7c7c7c" - toolTipText: qsTr("Close") - - Action { - enabled: parent.visible - shortcut: StandardKey.Cancel - onTriggered: leavePage() - } - - onClicked: { - leavePage() - } - } }