From 8e2d1e5cc818e954263fff3748204f2d0c4be7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= Date: Fri, 5 Aug 2022 15:21:42 -0400 Subject: [PATCH] jamiidentifier: minor fixes + Fix bottom margin + Add copy icon from media-resources + Wrap ID in read only + remove fieldLayoutWidth/fieldLayoutHeight GitLab: #770 Change-Id: I65743ca488d3bc601ac7d74d920d0944f03e0ace --- resources/icons/content_copy_24dp.svg | 10 +++++++++- src/app/commoncomponents/EditableLineEdit.qml | 6 +----- src/app/commoncomponents/MaterialLineEdit.qml | 2 -- src/app/commoncomponents/UsernameLineEdit.qml | 3 --- src/app/mainview/components/JamiIdentifier.qml | 4 +--- src/app/mainview/components/NewSwarmPage.qml | 2 -- src/app/mainview/components/SwarmDetailsPanel.qml | 6 ------ src/app/settingsview/components/AccountProfile.qml | 1 + src/app/settingsview/components/JamiUserIdentity.qml | 7 +------ src/app/wizardview/components/ProfilePage.qml | 4 ---- 10 files changed, 13 insertions(+), 32 deletions(-) diff --git a/resources/icons/content_copy_24dp.svg b/resources/icons/content_copy_24dp.svg index 844a4f99..d220c32c 100644 --- a/resources/icons/content_copy_24dp.svg +++ b/resources/icons/content_copy_24dp.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/src/app/commoncomponents/EditableLineEdit.qml b/src/app/commoncomponents/EditableLineEdit.qml index 5bcca2eb..ed99f1a4 100644 --- a/src/app/commoncomponents/EditableLineEdit.qml +++ b/src/app/commoncomponents/EditableLineEdit.qml @@ -37,8 +37,6 @@ Item { property alias underlined: lineEdit.underlined property alias wrapMode: lineEdit.wrapMode property alias padding: lineEdit.padding - property alias fieldLayoutWidth: lineEdit.fieldLayoutWidth - property alias fieldLayoutHeight: lineEdit.fieldLayoutHeight property alias echoMode: lineEdit.echoMode property string inactiveColor: JamiTheme.tintedBlue property string hoveredColor: "#03B9E9" @@ -161,16 +159,14 @@ Item { id: lineEdit anchors.horizontalCenter: row.horizontalCenter width: row.width - firstIco_.width - thirdIco_.width - secIco_.width - thirdIco_.anchors.rightMargin - height: row.height readOnly: !editable || root.readOnly underlined: true verticalAlignment: Text.AlignBottom borderColor: root.editIconColor - fieldLayoutHeight: row.height placeholderText: readOnly? root.placeholderText : "" - wrapMode: Text.NoWrap + wrapMode: readOnly? TextEdit.WrapAnywhere : TextEdit.NoWrap horizontalAlignment: !readOnly || text !== "" ? Qt.AlignLeft : Qt.AlignHCenter onFocusChanged: function(focus) { diff --git a/src/app/commoncomponents/MaterialLineEdit.qml b/src/app/commoncomponents/MaterialLineEdit.qml index dce122c4..fa881a14 100644 --- a/src/app/commoncomponents/MaterialLineEdit.qml +++ b/src/app/commoncomponents/MaterialLineEdit.qml @@ -26,8 +26,6 @@ TextField { id: root property int fontSize: JamiTheme.materialLineEditPointSize - property int fieldLayoutWidth: 256 - property int fieldLayoutHeight: 48 property var backgroundColor: JamiTheme.secondaryBackgroundColor property var borderColor: JamiTheme.greyBorderColor diff --git a/src/app/commoncomponents/UsernameLineEdit.qml b/src/app/commoncomponents/UsernameLineEdit.qml index f2553c2d..3f3afbe3 100644 --- a/src/app/commoncomponents/UsernameLineEdit.qml +++ b/src/app/commoncomponents/UsernameLineEdit.qml @@ -35,9 +35,6 @@ EditableLineEdit { informationToolTip: JamiStrings.usernameToolTip - fieldLayoutWidth: 200 - fieldLayoutHeight: 50 - enum NameRegistrationState { BLANK, INVALID, diff --git a/src/app/mainview/components/JamiIdentifier.qml b/src/app/mainview/components/JamiIdentifier.qml index 6c2426ab..2cd17728 100644 --- a/src/app/mainview/components/JamiIdentifier.qml +++ b/src/app/mainview/components/JamiIdentifier.qml @@ -46,12 +46,10 @@ Rectangle { Layout.leftMargin: JamiTheme.jamiIdMargins property var minWidth: mainRectangle.width + secondLine.implicitWidth width: Math.max(minWidth, jamiRegisteredNameText.width + 2 * JamiTheme.preferredMarginSize) - height: component.implicitHeight + height: firstLine.implicitHeight + jamiRegisteredNameText.height + 12 color: JamiTheme.secondaryBackgroundColor ColumnLayout { - id: component - RowLayout { id: firstLine Layout.alignment: Qt.AlignTop diff --git a/src/app/mainview/components/NewSwarmPage.qml b/src/app/mainview/components/NewSwarmPage.qml index 1a00870c..1533ad1c 100644 --- a/src/app/mainview/components/NewSwarmPage.qml +++ b/src/app/mainview/components/NewSwarmPage.qml @@ -128,8 +128,6 @@ Rectangle { verticalAlignment: Text.AlignVCenter - fieldLayoutWidth: 10 - placeholderText: JamiStrings.swarmName tooltipText: JamiStrings.swarmName backgroundColor: root.color diff --git a/src/app/mainview/components/SwarmDetailsPanel.qml b/src/app/mainview/components/SwarmDetailsPanel.qml index f8c5b9f3..03f023fe 100644 --- a/src/app/mainview/components/SwarmDetailsPanel.qml +++ b/src/app/mainview/components/SwarmDetailsPanel.qml @@ -72,9 +72,6 @@ Rectangle { firstIco: JamiResources.round_edit_24dp_svg secondIco: editable ? JamiResources.close_black_24dp_svg : "" - fieldLayoutWidth: 15 - fieldLayoutHeight: 30 - fontSize: 20 borderColor: "transparent" @@ -121,9 +118,6 @@ Rectangle { verticalAlignment: Text.AlignVCenter Layout.preferredWidth: JamiTheme.preferredFieldWidth - fieldLayoutWidth: 15 - fieldLayoutHeight: 30 - fontSize: 16 firstIco: JamiResources.round_edit_24dp_svg diff --git a/src/app/settingsview/components/AccountProfile.qml b/src/app/settingsview/components/AccountProfile.qml index 01283264..2e9f5a06 100644 --- a/src/app/settingsview/components/AccountProfile.qml +++ b/src/app/settingsview/components/AccountProfile.qml @@ -76,6 +76,7 @@ ColumnLayout { font.pointSize: JamiTheme.textFontSize font.kerning: true text: CurrentAccount.alias + placeholderText: JamiStrings.enterNickname horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter diff --git a/src/app/settingsview/components/JamiUserIdentity.qml b/src/app/settingsview/components/JamiUserIdentity.qml index 49b71848..9234ca74 100644 --- a/src/app/settingsview/components/JamiUserIdentity.qml +++ b/src/app/settingsview/components/JamiUserIdentity.qml @@ -122,12 +122,7 @@ ColumnLayout { anchors.verticalCenter: parent.verticalCenter height: JamiTheme.preferredFieldHeight - width: { - var maximumWidth = parent.width - lblRegisteredName.width - - JamiTheme.preferredMarginSize - return fieldLayoutWidth < maximumWidth ? - fieldLayoutWidth : maximumWidth - } + width: JamiTheme.preferredFieldWidth padding: 8 horizontalAlignment: CurrentAccount.registeredName === "" ? Text.AlignLeft : diff --git a/src/app/wizardview/components/ProfilePage.qml b/src/app/wizardview/components/ProfilePage.qml index d623cb02..d0e013ce 100644 --- a/src/app/wizardview/components/ProfilePage.qml +++ b/src/app/wizardview/components/ProfilePage.qml @@ -129,8 +129,6 @@ Rectangle { property string lastFirstChar - Layout.preferredHeight: fieldLayoutHeight - Layout.preferredWidth: fieldLayoutWidth Layout.alignment: Qt.AlignCenter focus: visible @@ -147,8 +145,6 @@ Rectangle { font.pointSize: JamiTheme.textFontSize font.kerning: true - fieldLayoutWidth: saveProfileBtn.width - KeyNavigation.tab: saveProfileBtn KeyNavigation.down: KeyNavigation.tab