From 0862273baf049ba271a5d07bf7578278553045d2 Mon Sep 17 00:00:00 2001 From: Noelia Date: Mon, 22 May 2023 17:11:50 +0200 Subject: [PATCH] feat(SQ/StatusInput): Added new property to override char limit label Added `charLimitLabel`. If it is set, the default char limit label will be overriden. --- ui/StatusQ/src/StatusQ/Controls/StatusInput.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml b/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml index 2cedcb73d3..6337d99acc 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusInput.qml @@ -111,6 +111,11 @@ Item { This property sets the character limit of the text input. */ property int charLimit: 0 + /*! + \qmlproperty string StatusInput::charLimitLabel + This property overrides the char default chart limit text format. + */ + property string charLimitLabel: "" /*! \qmlproperty string StatusInput::errorMessage This property sets the error message text. @@ -417,11 +422,11 @@ Item { } StatusBaseText { - id: charLimitLabel + id: charLimitLabelItem Layout.alignment: Qt.AlignVCenter height: visible ? contentHeight : 0 visible: root.charLimit > 0 - text: "%1 / %2".arg(Utils.encodeUtf8(statusBaseInput.text).length).arg(root.charLimit) + text: root.charLimitLabel ? root.charLimitLabel : "%1 / %2".arg(Utils.encodeUtf8(statusBaseInput.text).length).arg(root.charLimit) font.pixelSize: 12 color: statusBaseInput.enabled ? Theme.palette.baseColor1 : Theme.palette.directColor6 }