From 97a5c33e6fc6c3c17edb4360aef50127fdb56268 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Fri, 23 Jul 2021 13:19:34 +0200 Subject: [PATCH] fix(StatusBaseInput): some minor style adjustment to adhere to design --- ui/StatusQ/src/StatusQ/Controls/StatusBaseInput.qml | 7 ++++--- ui/StatusQ/src/StatusQ/Controls/StatusInput.qml | 11 +++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusBaseInput.qml b/ui/StatusQ/src/StatusQ/Controls/StatusBaseInput.qml index 92f4f401d8..962b9d570c 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusBaseInput.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusBaseInput.qml @@ -34,8 +34,8 @@ Item { property real leftPadding: 16 property real rightPadding: 16 - property real topPadding: 11 - property real bottomPadding: 11 + property real topPadding: 12 + property real bottomPadding: 12 property real minimumHeight: 0 property real maximumHeight: 0 @@ -43,7 +43,7 @@ Item { property bool valid: true implicitWidth: 448 - implicitHeight: multiline ? Math.max(edit.implicitHeight + topPadding + bottomPadding, 40) : 40 + implicitHeight: multiline ? Math.max(edit.implicitHeight + topPadding + bottomPadding, 44) : 44 Rectangle { width: parent.width @@ -139,6 +139,7 @@ Item { visible: edit.text.length === 0 anchors.left: parent.left anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter font.pixelSize: 15 elide: StatusBaseText.ElideRight diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml b/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml index 65ab5ead26..54f7ae0796 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml @@ -35,7 +35,10 @@ Rectangle { anchors.left: parent.left anchors.topMargin: visible ? 8 : 0 anchors.leftMargin: 16 + anchors.right: charLimitLabel.visible ? charLimitLabel.left : parent.right + anchors.rightMargin: 16 visible: !!root.label + elide: Text.ElideRight text: root.label font.pixelSize: 15 @@ -49,9 +52,9 @@ Rectangle { anchors.right: parent.right anchors.topMargin: visible ? 11 : 0 anchors.rightMargin: 16 - visible: !!root.charLimit + visible: root.charLimit > 0 - text: "0 / " + root.charLimit + text: "%1 / %2".arg(statusBaseInput.text.length).arg(root.charLimit) font.pixelSize: 12 color: statusBaseInput.enabled ? Theme.palette.baseColor1 : Theme.palette.directColor6 } @@ -74,6 +77,8 @@ Rectangle { anchors.topMargin: 11 anchors.right: parent.right anchors.rightMargin: 16 + anchors.left: parent.left + anchors.leftMargin: 16 height: visible ? implicitHeight : 0 visible: !!root.errorMessage && !statusBaseInput.valid @@ -81,5 +86,7 @@ Rectangle { font.pixelSize: 12 color: Theme.palette.dangerColor1 text: root.errorMessage + horizontalAlignment: Text.AlignRight + wrapMode: Text.WordWrap } }