From 9914d496de4c48fa990ce2f09c7c888d8ea77fd7 Mon Sep 17 00:00:00 2001 From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> Date: Mon, 9 Aug 2021 14:00:23 -0400 Subject: [PATCH] misc: refactor materialbutton A button component should have implicit dimensions based on it's content item. This patch provides implicit dimensioning around the content item so that non-fixed size buttons can be made by not specifying the preferredWidth property. Change-Id: Idc30eb1d9a33d8dd4b416e1060b45593b4fc4cba --- .../AccountMigrationDialog.qml | 8 +- src/commoncomponents/DaemonReconnectPopup.qml | 6 +- src/commoncomponents/DeleteAccountDialog.qml | 10 +- src/commoncomponents/MaterialButton.qml | 216 ++++++++++-------- src/commoncomponents/PasswordDialog.qml | 8 +- .../PreferenceItemDelegate.qml | 9 +- src/commoncomponents/SimpleMessageDialog.qml | 5 +- src/commoncomponents/SpinnerButton.qml | 2 +- src/constant/JamiTheme.qml | 1 + src/mainview/components/AboutPopUp.qml | 5 +- src/mainview/components/SelectScreen.qml | 3 +- src/mainview/components/UserProfile.qml | 7 +- src/mainview/components/WelcomePage.qml | 11 +- .../components/AdvancedCallSettings.qml | 7 +- .../components/CurrentAccountSettings.qml | 40 ++-- .../components/JamiUserIdentity.qml | 5 +- .../components/KeyBoardShortcutTable.qml | 4 +- .../components/LinkDeviceDialog.qml | 15 +- src/settingsview/components/LinkedDevices.qml | 6 +- src/settingsview/components/LogsView.qml | 15 +- .../components/NameRegistrationDialog.qml | 15 +- .../components/PluginListPreferencesView.qml | 11 +- .../components/PluginListSettingsView.qml | 7 +- .../components/RecordingSettings.qml | 7 +- .../components/RevokeDevicePasswordDialog.qml | 10 +- .../components/SettingMaterialButton.qml | 5 +- .../components/SystemSettings.qml | 7 +- .../components/TroubleshootSettings.qml | 14 +- .../components/UpdateSettings.qml | 10 +- src/wizardview/components/BackupKeyPage.qml | 8 +- .../ConnectToAccountManagerPage.qml | 4 +- .../components/CreateAccountPage.qml | 16 +- .../components/CreateSIPAccountPage.qml | 4 +- .../components/ImportFromBackupPage.qml | 10 +- .../components/ImportFromDevicePage.qml | 4 +- src/wizardview/components/ProfilePage.qml | 8 +- src/wizardview/components/WelcomePage.qml | 60 +++-- 37 files changed, 309 insertions(+), 274 deletions(-) diff --git a/src/commoncomponents/AccountMigrationDialog.qml b/src/commoncomponents/AccountMigrationDialog.qml index 733358c1a..43f548261 100644 --- a/src/commoncomponents/AccountMigrationDialog.qml +++ b/src/commoncomponents/AccountMigrationDialog.qml @@ -440,8 +440,8 @@ Window { id: migrationPushButton Layout.alignment: Qt.AlignLeft - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -459,8 +459,8 @@ Window { id: deleteAccountPushButton Layout.alignment: Qt.AlignRight - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 color: JamiTheme.buttonTintedRed hoveredColor: JamiTheme.buttonTintedRedHovered diff --git a/src/commoncomponents/DaemonReconnectPopup.qml b/src/commoncomponents/DaemonReconnectPopup.qml index 640b2bc93..568ea835f 100644 --- a/src/commoncomponents/DaemonReconnectPopup.qml +++ b/src/commoncomponents/DaemonReconnectPopup.qml @@ -85,9 +85,9 @@ ModalPopup { id: btnOk Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.bottomMargin: preferredMargin + + preferredWidth: JamiTheme.preferredFieldWidth / 2 + visible: connectionFailed text: qsTr("Ok") diff --git a/src/commoncomponents/DeleteAccountDialog.qml b/src/commoncomponents/DeleteAccountDialog.qml index 41093d42d..1f9e5932d 100644 --- a/src/commoncomponents/DeleteAccountDialog.qml +++ b/src/commoncomponents/DeleteAccountDialog.qml @@ -144,8 +144,9 @@ BaseDialog { id: btnDelete Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedRed hoveredColor: JamiTheme.buttonTintedRedHovered @@ -165,8 +166,9 @@ BaseDialog { id: btnCancel Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/commoncomponents/MaterialButton.qml b/src/commoncomponents/MaterialButton.qml index 2a83d8b64..85a9f0a82 100644 --- a/src/commoncomponents/MaterialButton.qml +++ b/src/commoncomponents/MaterialButton.qml @@ -18,38 +18,45 @@ import QtQuick 2.14 import QtQuick.Controls 2.14 -import QtGraphicalEffects 1.14 -import QtQuick.Window 2.14 +import QtQuick.Layouts 1.14 import net.jami.Constants 1.0 +// TODO: this component suffers from excessive responsibility +// and should have fixed width and content width defined variations +// as well as better handling for the animated icon Button { id: root - property alias fontCapitalization: buttonText.font.capitalization - property alias source: buttonImage.source + property bool outlined: false property alias toolTipText: toolTip.text - property var color: "transparent" - property var hoveredColor: undefined - property var pressedColor: undefined + property alias iconSource: icon.source_ + property alias animatedIconSource: icon.animatedSource_ + property real iconSize: 18 + property var color: JamiTheme.buttonTintedBlue + property var hoveredColor: JamiTheme.buttonTintedBlueHovered + property var pressedColor: JamiTheme.buttonTintedBluePressed property var keysNavigationFocusColor: Qt.darker(hoveredColor, 2) - property var outlined: false - property string animatedImageSource: "" - - property var preferredWidth: 400 - property var preferredHeight: 36 - property var minimumIconTextSpacing: 10 - property var iconPreferredHeight: 18 - property var iconPreferredWidth: 18 - - property bool enableElide: true - property int elide: Text.ElideRight - property int textActualWidth: buttonTextMetrics.boundingRect.width + property bool hasIcon: animatedIconSource.length !== 0 || + iconSource.length !== 0 + + property var preferredWidth + Binding on width { + when: root.preferredWidth !== undefined || + root.Layout.fillWidth + value: root.preferredWidth + } + Binding on Layout.preferredWidth { + when: root.preferredWidth !== undefined || + root.Layout.fillWidth + value: width + } - font.kerning: true - font.pointSize: JamiTheme.textFontSize + property real preferredHeight: 36 + height: preferredHeight + Layout.preferredHeight: height - hoverEnabled: hoveredColor !== undefined + focusPolicy: Qt.TabFocus MaterialToolTip { id: toolTip @@ -59,109 +66,128 @@ Button { delay: Qt.styleHints.mousePressAndHoldInterval } + property string contentColorProvider: { + if (!root.outlined) + return "white" + if (root.hovered) + return root.hoveredColor + if (root.down) + return root.pressedColor + return root.color + } + contentItem: Item { - Rectangle { - anchors.fill: parent - color: "transparent" - - AnimatedImage { - id: buttonAnimatedImage - - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: JamiTheme.preferredMarginSize / 2 - - height: iconPreferredHeight - width: iconPreferredWidth - - source: animatedImageSource - playing: true - paused: false - fillMode: Image.PreserveAspectFit - mipmap: true - visible: animatedImageSource.length !== 0 + id: item + + Binding on implicitWidth { + when: root.preferredWidth === undefined || + !root.Layout.fillWidth + value: item.childrenRect.width + } + implicitHeight: childrenRect.height + RowLayout { + anchors.verticalCenter: parent.verticalCenter + Binding on width { + when: root.preferredWidth !== undefined || + root.Layout.fillWidth + value: root.availableWidth + } + spacing: hasIcon ? + JamiTheme.preferredMarginSize : + 0 + + Component { + id: iconComponent + + ResponsiveImage { + source: source_ + Layout.preferredWidth: iconSize + Layout.preferredHeight: iconSize + color: contentColorProvider + } } - ResponsiveImage { - id: buttonImage - - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: JamiTheme.preferredMarginSize / 2 - - height: iconPreferredHeight - width: iconPreferredWidth - - visible: source.toString().length !== 0 - color: { - if (!outlined) - return "white" - if (hovered && root.hoveredColor) - return root.hoveredColor - if (checked && root.pressedColor) - return root.pressedColor - return root.color + Component { + id: animatedIconComponent + + AnimatedImage { + source: animatedSource_ + Layout.preferredWidth: iconSize + Layout.preferredHeight: iconSize + width: iconSize + height: iconSize + playing: true + fillMode: Image.PreserveAspectFit + mipmap: true } } - Text { - id: buttonText + Loader { + id: icon - anchors.centerIn: parent + property string source_ + property string animatedSource_ - width: { - var iconWidth = (buttonAnimatedImage.visible || buttonImage.visible) ? - iconPreferredWidth : 0 - return (parent.width / 2 - iconWidth - - JamiTheme.preferredMarginSize / 2 - minimumIconTextSpacing) * 2 - } + active: hasIcon - TextMetrics { - id: buttonTextMetrics + Layout.preferredWidth: active * width - font: buttonText.font - text: buttonText.text - } + Layout.alignment: Qt.AlignVCenter + Layout.leftMargin: hasIcon ? + JamiTheme.preferredMarginSize / 2 : + undefined + sourceComponent: animatedSource_.length !== 0 ? + animatedIconComponent : + iconComponent + } - text: root.text - elide: enableElide ? root.elide : Text.ElideNone - color: { - if (!outlined) - return "white" - if (hovered && root.hoveredColor) - return root.hoveredColor - if (checked && root.pressedColor) - return root.pressedColor - return root.color + Text { + // this right margin will make the text visually + // centered within button + Layout.rightMargin: { + if ((!hasIcon || root.preferredWidth === undefined) && + !root.Layout.fillWidth) + return undefined + return icon.width + JamiTheme.preferredMarginSize / 2 + + parent.spacing } + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + text: root.text font: root.font + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter + color: contentColorProvider } } } background: Rectangle { - id: backgroundRect anchors.fill: parent color: { - if (outlined) + if (root.outlined) return "transparent" - if (hovered && root.hoveredColor) + if (root.hovered) return root.hoveredColor - if (checked && root.pressedColor) + if (root.down) return root.pressedColor - return root.focus ? root.keysNavigationFocusColor : root.color + return root.focus ? + root.keysNavigationFocusColor : + root.color } border.color: { - if (!outlined) + if (!root.outlined) return "transparent" - if (hovered && root.hoveredColor) + if (root.hovered) return root.hoveredColor - if (checked && root.pressedColor) + if (root.down) return root.pressedColor - return root.focus ? root.keysNavigationFocusColor : root.color + return root.focus ? + root.keysNavigationFocusColor : + root.color } - radius: 4 + radius: JamiTheme.primaryRadius } Keys.onPressed: function (keyEvent) { diff --git a/src/commoncomponents/PasswordDialog.qml b/src/commoncomponents/PasswordDialog.qml index 3d0baa8d3..c2b0059d3 100644 --- a/src/commoncomponents/PasswordDialog.qml +++ b/src/commoncomponents/PasswordDialog.qml @@ -190,8 +190,8 @@ BaseDialog { id: btnConfirm Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -212,8 +212,8 @@ BaseDialog { id: btnCancel Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/commoncomponents/PreferenceItemDelegate.qml b/src/commoncomponents/PreferenceItemDelegate.qml index 57b3ea9d1..20e82cbce 100644 --- a/src/commoncomponents/PreferenceItemDelegate.qml +++ b/src/commoncomponents/PreferenceItemDelegate.qml @@ -172,15 +172,16 @@ ItemDelegate { id: pathPreferenceButton visible: preferenceType === PreferenceItemDelegate.PATH - width: root.width / 2 - 8 - Layout.preferredWidth: width - Layout.preferredHeight: 30 + + preferredWidth: root.width / 2 - 8 + preferredHeight: 30 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.rightMargin: 4 text: UtilsAdapter.fileName(preferenceCurrentValue) toolTipText: JamiStrings.chooseImageFile - source: JamiResources.round_folder_24dp_svg + iconSource: JamiResources.round_folder_24dp_svg color: JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedGreyHovered pressedColor: JamiTheme.buttonTintedGreyPressed diff --git a/src/commoncomponents/SimpleMessageDialog.qml b/src/commoncomponents/SimpleMessageDialog.qml index f1c904beb..53cd2ec0f 100644 --- a/src/commoncomponents/SimpleMessageDialog.qml +++ b/src/commoncomponents/SimpleMessageDialog.qml @@ -91,8 +91,9 @@ BaseDialog { model: buttonTitles.length MaterialButton { Layout.alignment: Qt.AlignVCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 + preferredHeight: JamiTheme.preferredFieldHeight color: { switch(buttonStyles[modelData]) { diff --git a/src/commoncomponents/SpinnerButton.qml b/src/commoncomponents/SpinnerButton.qml index f0306a5e9..ae6103f94 100644 --- a/src/commoncomponents/SpinnerButton.qml +++ b/src/commoncomponents/SpinnerButton.qml @@ -28,7 +28,7 @@ MaterialButton { property string spinnerTriggeredtext: value property string normalText: value - animatedImageSource: spinnerTriggered ? + animatedIconSource: spinnerTriggered ? JamiResources.jami_rolling_spinner_gif : "" text: spinnerTriggered ? spinnerTriggeredtext : normalText diff --git a/src/constant/JamiTheme.qml b/src/constant/JamiTheme.qml index 381a8728b..24812918a 100644 --- a/src/constant/JamiTheme.qml +++ b/src/constant/JamiTheme.qml @@ -308,6 +308,7 @@ Item { property real welcomeLabelPointSize: 30 property real welcomeLogoWidth: 330 property real welcomeLogoHeight: 110 + property real wizardButtonWidth: 400 // Main application spec property real mainViewMinWidth: 300 diff --git a/src/mainview/components/AboutPopUp.qml b/src/mainview/components/AboutPopUp.qml index 0c251ed91..2e46020f6 100644 --- a/src/mainview/components/AboutPopUp.qml +++ b/src/mainview/components/AboutPopUp.qml @@ -234,10 +234,11 @@ ModalPopup { id: btnClose Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.bottomMargin: JamiTheme.preferredMarginSize + preferredWidth: JamiTheme.preferredFieldWidth / 2 + preferredHeight: JamiTheme.preferredFieldHeight + text: qsTr("Close") color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/mainview/components/SelectScreen.qml b/src/mainview/components/SelectScreen.qml index dcb262f46..1bf6ccc4b 100644 --- a/src/mainview/components/SelectScreen.qml +++ b/src/mainview/components/SelectScreen.qml @@ -347,8 +347,7 @@ Window { anchors.bottomMargin: JamiTheme.preferredMarginSize anchors.horizontalCenter: selectScreenWindowRect.horizontalCenter - width: 200 - height: 36 + preferredWidth: 200 visible: selectedScreenNumber != -1 || selectAllScreens diff --git a/src/mainview/components/UserProfile.qml b/src/mainview/components/UserProfile.qml index 3d535a68f..6606be857 100644 --- a/src/mainview/components/UserProfile.qml +++ b/src/mainview/components/UserProfile.qml @@ -213,7 +213,7 @@ BaseDialog { text: JamiStrings.isSwarm color: JamiTheme.faddedFontColor } - + Text { Layout.alignment: Qt.AlignLeft font.pointSize: JamiTheme.textFontSize @@ -226,8 +226,9 @@ BaseDialog { Layout.columnSpan: 2 Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/mainview/components/WelcomePage.qml b/src/mainview/components/WelcomePage.qml index 5bdff512f..28ad664c4 100644 --- a/src/mainview/components/WelcomePage.qml +++ b/src/mainview/components/WelcomePage.qml @@ -159,21 +159,14 @@ Rectangle { Layout.alignment: Qt.AlignBottom | Qt.AlignHCenter Layout.bottomMargin: JamiTheme.preferredMarginSize - Layout.preferredWidth: JamiTheme.aboutButtonPreferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.aboutButtonPreferredWidth color: JamiTheme.buttonTintedBlack - enableElide: false hoveredColor: JamiTheme.buttonTintedBlackHovered pressedColor: JamiTheme.buttonTintedBlackPressed outlined: true - onTextActualWidthChanged: { - if (textActualWidth > btnAboutPopUp.Layout.preferredWidth) - btnAboutPopUp.Layout.preferredWidth = - textActualWidth + JamiTheme.preferredMarginSize * 2 - } - text: JamiStrings.aboutJami onClicked: aboutPopUpDialog.open() diff --git a/src/settingsview/components/AdvancedCallSettings.qml b/src/settingsview/components/AdvancedCallSettings.qml index 5e1eb0611..5c2917540 100644 --- a/src/settingsview/components/AdvancedCallSettings.qml +++ b/src/settingsview/components/AdvancedCallSettings.qml @@ -215,8 +215,9 @@ ColumnLayout { id: addDefaultModeratorPushButton Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -224,7 +225,7 @@ ColumnLayout { outlined: true toolTipText: JamiStrings.addDefaultModerator - source: JamiResources.round_add_24dp_svg + iconSource: JamiResources.round_add_24dp_svg text: JamiStrings.addDefaultModerator diff --git a/src/settingsview/components/CurrentAccountSettings.qml b/src/settingsview/components/CurrentAccountSettings.qml index f04d07737..44195f945 100644 --- a/src/settingsview/components/CurrentAccountSettings.qml +++ b/src/settingsview/components/CurrentAccountSettings.qml @@ -221,8 +221,9 @@ Rectangle { visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === "" Layout.alignment: Qt.AlignHCenter Layout.topMargin: JamiTheme.preferredMarginSize - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -230,14 +231,15 @@ Rectangle { outlined: true toolTipText: AccountAdapter.hasPassword() ? - JamiStrings.changeCurrentPassword : JamiStrings.setAPassword - text: AccountAdapter.hasPassword() ? JamiStrings.changePassword : JamiStrings.setPassword + JamiStrings.changeCurrentPassword : + JamiStrings.setAPassword + text: AccountAdapter.hasPassword() ? + JamiStrings.changePassword : + JamiStrings.setPassword - source: JamiResources.round_edit_24dp_svg + iconSource: JamiResources.round_edit_24dp_svg - onClicked: { - passwordClicked() - } + onClicked: passwordClicked() } MaterialButton { @@ -245,8 +247,9 @@ Rectangle { visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === "" Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -256,31 +259,28 @@ Rectangle { toolTipText: JamiStrings.tipBackupAccount text: JamiStrings.backupAccountBtn - source: JamiResources.round_save_alt_24dp_svg + iconSource: JamiResources.round_save_alt_24dp_svg - onClicked: { - exportAccountSlot() - } + onClicked: exportAccountSlot() } MaterialButton { Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.leftMargin: JamiTheme.preferredMarginSize Layout.rightMargin: JamiTheme.preferredMarginSize + preferredWidth: JamiTheme.preferredFieldWidth + preferredHeight: JamiTheme.preferredFieldHeight + color: JamiTheme.buttonTintedRed hoveredColor: JamiTheme.buttonTintedRedHovered pressedColor: JamiTheme.buttonTintedRedPressed text: JamiStrings.deleteAccount - source: JamiResources.delete_forever_24dp_svg + iconSource: JamiResources.delete_forever_24dp_svg - onClicked: { - delAccountSlot() - } + onClicked: delAccountSlot() } LinkedDevices { diff --git a/src/settingsview/components/JamiUserIdentity.qml b/src/settingsview/components/JamiUserIdentity.qml index dfecc5ef5..7dd0ac09b 100644 --- a/src/settingsview/components/JamiUserIdentity.qml +++ b/src/settingsview/components/JamiUserIdentity.qml @@ -172,8 +172,9 @@ ColumnLayout { Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.rightMargin: currentRegisteredID.width / 2 - width / 2 - Layout.preferredWidth: 120 - Layout.preferredHeight: 30 + + preferredWidth: 120 + preferredHeight: 30 visible: registeredIdNeedsSet && currentRegisteredID.nameRegistrationState === diff --git a/src/settingsview/components/KeyBoardShortcutTable.qml b/src/settingsview/components/KeyBoardShortcutTable.qml index b5843cf6f..4eb49f72c 100644 --- a/src/settingsview/components/KeyBoardShortcutTable.qml +++ b/src/settingsview/components/KeyBoardShortcutTable.qml @@ -607,8 +607,8 @@ BaseDialog { anchors.bottomMargin: JamiTheme.preferredMarginSize anchors.horizontalCenter: parent.horizontalCenter - width: JamiTheme.preferredFieldWidth / 2 - height: JamiTheme.preferredFieldHeight + preferredWidth: JamiTheme.preferredFieldWidth / 2 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/settingsview/components/LinkDeviceDialog.qml b/src/settingsview/components/LinkDeviceDialog.qml index db1059920..3afddc87a 100644 --- a/src/settingsview/components/LinkDeviceDialog.qml +++ b/src/settingsview/components/LinkDeviceDialog.qml @@ -170,8 +170,9 @@ BaseDialog { id: btnConfirm Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -190,8 +191,9 @@ BaseDialog { id: btnCancel Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -329,8 +331,9 @@ BaseDialog { id: btnCloseExportDialog Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/settingsview/components/LinkedDevices.qml b/src/settingsview/components/LinkedDevices.qml index ebc0468cb..695fe3e52 100644 --- a/src/settingsview/components/LinkedDevices.qml +++ b/src/settingsview/components/LinkedDevices.qml @@ -158,8 +158,8 @@ ColumnLayout { id: linkDevPushButton Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -167,7 +167,7 @@ ColumnLayout { outlined: true toolTipText: JamiStrings.tipLinkNewDevice - source: JamiResources.round_add_24dp_svg + iconSource: JamiResources.round_add_24dp_svg text: JamiStrings.linkAnotherDevice diff --git a/src/settingsview/components/LogsView.qml b/src/settingsview/components/LogsView.qml index 543eea97e..77bff4ebf 100644 --- a/src/settingsview/components/LogsView.qml +++ b/src/settingsview/components/LogsView.qml @@ -150,11 +150,12 @@ Dialog { id: clearButton Layout.alignment: Qt.AlignHCenter - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.preferredWidth: itemWidth / widthDivisor Layout.topMargin: JamiTheme.preferredMarginSize Layout.bottomMargin: JamiTheme.preferredMarginSize + preferredWidth: itemWidth / widthDivisor + preferredHeight: JamiTheme.preferredFieldHeight + outlined: true color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -175,8 +176,9 @@ Dialog { id: copyButton Layout.alignment: Qt.AlignHCenter - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.preferredWidth: itemWidth/widthDivisor + + preferredWidth: itemWidth / widthDivisor + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -210,12 +212,13 @@ Dialog { id: reportButton Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: itemWidth/widthDivisor - Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.topMargin: JamiTheme.preferredMarginSize Layout.bottomMargin: JamiTheme.preferredMarginSize Layout.rightMargin: JamiTheme.preferredMarginSize + preferredWidth: itemWidth / widthDivisor + preferredHeight: JamiTheme.preferredFieldHeight + color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered pressedColor: JamiTheme.buttonTintedBlackPressed diff --git a/src/settingsview/components/NameRegistrationDialog.qml b/src/settingsview/components/NameRegistrationDialog.qml index 208a522d6..0ae9e91dd 100644 --- a/src/settingsview/components/NameRegistrationDialog.qml +++ b/src/settingsview/components/NameRegistrationDialog.qml @@ -154,8 +154,9 @@ BaseDialog { id: btnRegister Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -174,8 +175,9 @@ BaseDialog { id: btnCancel Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -258,8 +260,9 @@ BaseDialog { id: btnClose Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/settingsview/components/PluginListPreferencesView.qml b/src/settingsview/components/PluginListPreferencesView.qml index f7e2a8b58..f59bef8c5 100644 --- a/src/settingsview/components/PluginListPreferencesView.qml +++ b/src/settingsview/components/PluginListPreferencesView.qml @@ -367,20 +367,21 @@ Rectangle { RowLayout { Layout.topMargin: 10 Layout.bottomMargin: 10 - height: 30 + Layout.preferredHeight: 30 + Layout.fillWidth: true MaterialButton { id: resetButton Layout.fillWidth: true - Layout.preferredHeight: JamiTheme.preferredFieldHeight + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered pressedColor: JamiTheme.buttonTintedBlackPressed outlined: true - source: JamiResources.settings_backup_restore_24dp_svg + iconSource: JamiResources.settings_backup_restore_24dp_svg text: JamiStrings.reset @@ -391,14 +392,14 @@ Rectangle { id: uninstallButton Layout.fillWidth: true - Layout.preferredHeight: JamiTheme.preferredFieldHeight + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered pressedColor: JamiTheme.buttonTintedBlackPressed outlined: true - source: JamiResources.delete_24dp_svg + iconSource: JamiResources.delete_24dp_svg text: qsTr("Uninstall") diff --git a/src/settingsview/components/PluginListSettingsView.qml b/src/settingsview/components/PluginListSettingsView.qml index f1bbc03e2..39db0e9eb 100644 --- a/src/settingsview/components/PluginListSettingsView.qml +++ b/src/settingsview/components/PluginListSettingsView.qml @@ -98,17 +98,18 @@ Rectangle { id: installButton Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.topMargin: JamiTheme.preferredMarginSize / 2 + preferredWidth: JamiTheme.preferredFieldWidth + preferredHeight: JamiTheme.preferredFieldHeight + color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered pressedColor: JamiTheme.buttonTintedBlackPressed outlined: true toolTipText: JamiStrings.addNewPlugin - source: JamiResources.round_add_24dp_svg + iconSource: JamiResources.round_add_24dp_svg text: JamiStrings.installPlugin diff --git a/src/settingsview/components/RecordingSettings.qml b/src/settingsview/components/RecordingSettings.qml index f233a0686..122662253 100644 --- a/src/settingsview/components/RecordingSettings.qml +++ b/src/settingsview/components/RecordingSettings.qml @@ -178,12 +178,13 @@ ColumnLayout { id: recordPathButton Layout.alignment: Qt.AlignRight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.preferredWidth: itemWidth + + preferredWidth: itemWidth + preferredHeight: JamiTheme.preferredFieldHeight toolTipText: JamiStrings.tipRecordFolder text: recordPath - source: JamiResources.round_folder_24dp_svg + iconSource: JamiResources.round_folder_24dp_svg color: JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedGreyHovered pressedColor: JamiTheme.buttonTintedGreyPressed diff --git a/src/settingsview/components/RevokeDevicePasswordDialog.qml b/src/settingsview/components/RevokeDevicePasswordDialog.qml index 1496d5d0c..ce195c8bc 100644 --- a/src/settingsview/components/RevokeDevicePasswordDialog.qml +++ b/src/settingsview/components/RevokeDevicePasswordDialog.qml @@ -93,8 +93,9 @@ BaseDialog { id: btnRemove Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -114,8 +115,9 @@ BaseDialog { id: btnCancel Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/settingsview/components/SettingMaterialButton.qml b/src/settingsview/components/SettingMaterialButton.qml index 187c8326c..37e8ef51b 100644 --- a/src/settingsview/components/SettingMaterialButton.qml +++ b/src/settingsview/components/SettingMaterialButton.qml @@ -64,11 +64,12 @@ RowLayout { MaterialButton { id: button - Layout.preferredWidth: root.itemWidth + Layout.fillHeight: true + preferredWidth: root.itemWidth text: root.textField - source: root.source + iconSource: root.source color: JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedGreyHovered pressedColor: JamiTheme.buttonTintedGreyPressed diff --git a/src/settingsview/components/SystemSettings.qml b/src/settingsview/components/SystemSettings.qml index cb2f0e775..8318c85d9 100644 --- a/src/settingsview/components/SystemSettings.qml +++ b/src/settingsview/components/SystemSettings.qml @@ -147,12 +147,13 @@ ColumnLayout { id: downloadButton Layout.alignment: Qt.AlignRight - Layout.preferredWidth: itemWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: itemWidth + preferredHeight: JamiTheme.preferredFieldHeight toolTipText: JamiStrings.tipChooseDownloadFolder text: downloadPath - source: JamiResources.round_folder_24dp_svg + iconSource: JamiResources.round_folder_24dp_svg color: JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedGreyHovered pressedColor: JamiTheme.buttonTintedGreyPressed diff --git a/src/settingsview/components/TroubleshootSettings.qml b/src/settingsview/components/TroubleshootSettings.qml index 94d4eb2e5..887487738 100644 --- a/src/settingsview/components/TroubleshootSettings.qml +++ b/src/settingsview/components/TroubleshootSettings.qml @@ -47,8 +47,7 @@ ColumnLayout{ verticalAlignment: Text.AlignVCenter } - RowLayout{ - + RowLayout { Text{ Layout.fillWidth: true Layout.preferredHeight: 30 @@ -62,15 +61,15 @@ ColumnLayout{ verticalAlignment: Text.AlignVCenter color: JamiTheme.textColor - } MaterialButton { id: enableTroubleshootingButton Layout.alignment: Qt.AlignRight - Layout.preferredHeight: JamiTheme.preferredFieldHeight - Layout.preferredWidth: itemWidth/1.5 + + preferredWidth: itemWidth / 1.5 + preferredHeight: JamiTheme.preferredFieldHeight color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -79,11 +78,8 @@ ColumnLayout{ text: JamiStrings.troubleshootButton - onClicked: { - logsView.open() - } + onClicked: logsView.open() } - } } diff --git a/src/settingsview/components/UpdateSettings.qml b/src/settingsview/components/UpdateSettings.qml index 5abdb4134..6a542629b 100644 --- a/src/settingsview/components/UpdateSettings.qml +++ b/src/settingsview/components/UpdateSettings.qml @@ -67,8 +67,9 @@ ColumnLayout { id: checkUpdateButton Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth + preferredHeight: JamiTheme.preferredFieldHeight color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered @@ -87,8 +88,9 @@ ColumnLayout { visible: !UpdateManager.isCurrentVersionBeta() Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: JamiTheme.preferredFieldWidth - Layout.preferredHeight: JamiTheme.preferredFieldHeight + + preferredWidth: JamiTheme.preferredFieldWidth + preferredHeight: JamiTheme.preferredFieldHeight color: enabled? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/wizardview/components/BackupKeyPage.qml b/src/wizardview/components/BackupKeyPage.qml index bdb9d1f41..b58dce855 100644 --- a/src/wizardview/components/BackupKeyPage.qml +++ b/src/wizardview/components/BackupKeyPage.qml @@ -184,8 +184,8 @@ Rectangle { objectName: "backupKeyPageBackupBtn" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.backupAccountBtn color: JamiTheme.buttonTintedGrey @@ -206,8 +206,8 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.bottomMargin: JamiTheme.wizardViewPageBackButtonMargins - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.skip color: JamiTheme.buttonTintedGrey diff --git a/src/wizardview/components/ConnectToAccountManagerPage.qml b/src/wizardview/components/ConnectToAccountManagerPage.qml index 43236c546..08bcfaee1 100644 --- a/src/wizardview/components/ConnectToAccountManagerPage.qml +++ b/src/wizardview/components/ConnectToAccountManagerPage.qml @@ -195,8 +195,8 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.bottomMargin: errorLabel.visible ? 0 : JamiTheme.wizardViewPageBackButtonMargins - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth spinnerTriggeredtext: JamiStrings.creatingAccount normalText: JamiStrings.connect diff --git a/src/wizardview/components/CreateAccountPage.qml b/src/wizardview/components/CreateAccountPage.qml index f850a2b82..bcb290879 100644 --- a/src/wizardview/components/CreateAccountPage.qml +++ b/src/wizardview/components/CreateAccountPage.qml @@ -169,10 +169,10 @@ Rectangle { objectName: "chooseUsernameButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight - fontCapitalization: Font.AllUppercase + preferredWidth: JamiTheme.wizardButtonWidth + + font.capitalization: Font.AllUppercase text: isRendezVous ? JamiStrings.chooseName : JamiStrings.chooseUsername enabled: usernameEdit.nameRegistrationState === UsernameLineEdit.NameRegistrationState.FREE color: usernameEdit.nameRegistrationState === UsernameLineEdit.NameRegistrationState.FREE ? @@ -194,8 +194,8 @@ Rectangle { objectName: "nameRegistrationPageSkipButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.skip color: JamiTheme.buttonTintedGrey @@ -348,8 +348,8 @@ Rectangle { objectName: "createAccountButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth function checkEnable() { return !passwordSwitch.checked || @@ -357,7 +357,7 @@ Rectangle { && passwordEdit.text.length !== 0) } - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase text: isRendezVous ? JamiStrings.createRV : JamiStrings.createAccount enabled: checkEnable() color: checkEnable() ? JamiTheme.wizardBlueButtons : diff --git a/src/wizardview/components/CreateSIPAccountPage.qml b/src/wizardview/components/CreateSIPAccountPage.qml index 2517b9612..8aca180f8 100644 --- a/src/wizardview/components/CreateSIPAccountPage.qml +++ b/src/wizardview/components/CreateSIPAccountPage.qml @@ -169,8 +169,8 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.bottomMargin: JamiTheme.wizardViewPageBackButtonMargins - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.createSIPAccount color: JamiTheme.wizardBlueButtons diff --git a/src/wizardview/components/ImportFromBackupPage.qml b/src/wizardview/components/ImportFromBackupPage.qml index 5929e483a..31ae31437 100644 --- a/src/wizardview/components/ImportFromBackupPage.qml +++ b/src/wizardview/components/ImportFromBackupPage.qml @@ -119,12 +119,12 @@ Rectangle { objectName: "fileImportBtn" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: fileImportBtnText toolTipText: JamiStrings.importAccountArchive - source: JamiResources.round_folder_24dp_svg + iconSource: JamiResources.round_folder_24dp_svg color: JamiTheme.buttonTintedGrey hoveredColor: JamiTheme.buttonTintedGreyHovered pressedColor: JamiTheme.buttonTintedGreyPressed @@ -204,8 +204,8 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.bottomMargin: errorLabel.visible ? 0 : JamiTheme.wizardViewPageBackButtonMargins - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth spinnerTriggeredtext: JamiStrings.generatingAccount normalText: JamiStrings.connectFromBackup diff --git a/src/wizardview/components/ImportFromDevicePage.qml b/src/wizardview/components/ImportFromDevicePage.qml index 8d37fd3d9..d26ad109c 100644 --- a/src/wizardview/components/ImportFromDevicePage.qml +++ b/src/wizardview/components/ImportFromDevicePage.qml @@ -167,8 +167,8 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.bottomMargin: errorLabel.visible ? 0 : JamiTheme.wizardViewPageBackButtonMargins - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth spinnerTriggeredtext: JamiStrings.generatingAccount normalText: JamiStrings.connectFromAnotherDevice diff --git a/src/wizardview/components/ProfilePage.qml b/src/wizardview/components/ProfilePage.qml index 87f4a592c..69a0fae71 100644 --- a/src/wizardview/components/ProfilePage.qml +++ b/src/wizardview/components/ProfilePage.qml @@ -177,8 +177,8 @@ Rectangle { objectName: "saveProfileBtn" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth enabled: !spinnerTriggered normalText: JamiStrings.saveProfile @@ -206,8 +206,8 @@ Rectangle { objectName: "skipProfileSavingButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.skip enabled: saveProfileBtn.enabled diff --git a/src/wizardview/components/WelcomePage.qml b/src/wizardview/components/WelcomePage.qml index 0fb452839..c812446c2 100644 --- a/src/wizardview/components/WelcomePage.qml +++ b/src/wizardview/components/WelcomePage.qml @@ -99,16 +99,13 @@ Rectangle { objectName: "newAccountButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.createAJamiAccount - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase toolTipText: JamiStrings.createNewJamiAccount - source: JamiResources.default_avatar_overlay_svg - color: JamiTheme.buttonTintedBlue - hoveredColor: JamiTheme.buttonTintedBlueHovered - pressedColor: JamiTheme.buttonTintedBluePressed + iconSource: JamiResources.default_avatar_overlay_svg KeyNavigation.tab: newRdvButton KeyNavigation.up: backButton.visible ? backButton : @@ -127,16 +124,13 @@ Rectangle { objectName: "newRdvButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.createRV - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase toolTipText: JamiStrings.createNewRV - source: JamiResources.groups_24dp_svg - color: JamiTheme.buttonTintedBlue - hoveredColor: JamiTheme.buttonTintedBlueHovered - pressedColor: JamiTheme.buttonTintedBluePressed + iconSource: JamiResources.groups_24dp_svg KeyNavigation.tab: fromDeviceButton KeyNavigation.up: newAccountButton @@ -152,13 +146,13 @@ Rectangle { objectName: "fromDeviceButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.linkFromAnotherDevice - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase toolTipText: JamiStrings.importAccountFromOtherDevice - source: JamiResources.devices_24dp_svg + iconSource: JamiResources.devices_24dp_svg color: JamiTheme.buttonTintedBlue hoveredColor: JamiTheme.buttonTintedBlueHovered pressedColor: JamiTheme.buttonTintedBluePressed @@ -177,13 +171,13 @@ Rectangle { objectName: "fromBackupButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.connectFromBackup - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase toolTipText: JamiStrings.importAccountFromBackup - source: JamiResources.backup_24dp_svg + iconSource: JamiResources.backup_24dp_svg color: JamiTheme.buttonTintedBlue hoveredColor: JamiTheme.buttonTintedBlueHovered pressedColor: JamiTheme.buttonTintedBluePressed @@ -206,11 +200,11 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.bottomMargin: newSIPAccountButton.visible ? 0 : JamiTheme.wizardViewPageBackButtonMargins - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth text: JamiStrings.advancedFeatures - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase toolTipText: showAdvanced ? JamiStrings.hideAdvancedFeatures : JamiStrings.showAdvancedFeatures color: JamiTheme.buttonTintedBlue @@ -238,15 +232,15 @@ Rectangle { objectName: "connectAccountManagerButton" Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth visible: false text: JamiStrings.connectJAMSServer - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase toolTipText: JamiStrings.createFromJAMS - source: JamiResources.router_24dp_svg + iconSource: JamiResources.router_24dp_svg color: JamiTheme.buttonTintedBlue hoveredColor: JamiTheme.buttonTintedBlueHovered pressedColor: JamiTheme.buttonTintedBluePressed @@ -266,15 +260,15 @@ Rectangle { Layout.alignment: Qt.AlignCenter Layout.bottomMargin: JamiTheme.wizardViewPageBackButtonMargins - Layout.preferredWidth: preferredWidth - Layout.preferredHeight: preferredHeight + + preferredWidth: JamiTheme.wizardButtonWidth visible: false text: JamiStrings.addSIPAccount - fontCapitalization: Font.AllUppercase + font.capitalization: Font.AllUppercase toolTipText: JamiStrings.createNewSipAccount - source: JamiResources.default_avatar_overlay_svg + iconSource: JamiResources.default_avatar_overlay_svg color: JamiTheme.buttonTintedBlue hoveredColor: JamiTheme.buttonTintedBlueHovered pressedColor: JamiTheme.buttonTintedBluePressed -- GitLab