From 8e2d1e5cc818e954263fff3748204f2d0c4be7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> 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 844a4f99e..d220c32c9 100644 --- a/resources/icons/content_copy_24dp.svg +++ b/resources/icons/content_copy_24dp.svg @@ -1 +1,9 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg> \ No newline at end of file +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve"> +<path d="M20.4,2.2H8.5c-0.9,0-1.6,0.7-1.6,1.6v2.9H3.6C2.7,6.7,2,7.4,2,8.3v11.9c0,0.9,0.7,1.6,1.6,1.6h11.9c0.9,0,1.6-0.7,1.6-1.6 + v-2.9h3.3c0.9,0,1.6-0.7,1.6-1.6V3.8C22,2.9,21.3,2.2,20.4,2.2z M15.8,20.2c0,0.2-0.1,0.3-0.3,0.3H3.6c-0.2,0-0.3-0.1-0.3-0.3V8.3 + C3.3,8.2,3.4,8,3.6,8h11.9c0.2,0,0.3,0.1,0.3,0.3V20.2z M20.7,15.7c0,0.2-0.1,0.3-0.3,0.3h-3.3V8.3c0-0.9-0.7-1.6-1.6-1.6H8.2V3.8 + c0-0.2,0.1-0.3,0.3-0.3h11.9c0.2,0,0.3,0.1,0.3,0.3V15.7z"/> +</svg> \ No newline at end of file diff --git a/src/app/commoncomponents/EditableLineEdit.qml b/src/app/commoncomponents/EditableLineEdit.qml index 5bcca2eb7..ed99f1a4e 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 dce122c4f..fa881a147 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 f2553c2d7..3f3afbe35 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 6c2426ab1..2cd177284 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 1a00870c4..1533ad1c3 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 f8c5b9f30..03f023fe7 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 01283264b..2e9f5a06a 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 49b718486..9234ca740 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 d623cb025..d0e013ce3 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 -- GitLab