From: Claudio Cambra Date: Mon, 8 May 2023 12:02:43 +0000 (+0800) Subject: Add ability for NCInputTextField to display red border when invalid input provided X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~92^2^2~84^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=00ec93f03111eca99a2bd0f2ce8d70dd103d3638;p=nextcloud-desktop.git Add ability for NCInputTextField to display red border when invalid input provided Signed-off-by: Claudio Cambra --- diff --git a/src/gui/filedetails/NCInputTextField.qml b/src/gui/filedetails/NCInputTextField.qml index 37a7d23dc..fa4bef0bf 100644 --- a/src/gui/filedetails/NCInputTextField.qml +++ b/src/gui/filedetails/NCInputTextField.qml @@ -25,6 +25,7 @@ TextField { readonly property color accentColor: Style.ncBlue readonly property color secondaryColor: palette.dark readonly property alias submitButton: submitButton + property bool validInput: true implicitHeight: Style.talkReplyTextFieldPreferredHeight @@ -36,7 +37,7 @@ TextField { id: textFieldBorder radius: Style.slightlyRoundedButtonRadius border.width: Style.normalBorderWidth - border.color: root.activeFocus ? root.accentColor : root.secondaryColor + border.color: root.activeFocus ? root.validInput ? root.accentColor : Style.errorBoxBackgroundColor : root.secondaryColor color: palette.base } @@ -55,7 +56,7 @@ TextField { icon.source: "image://svgimage-custom-color/confirm.svg" + "/" + root.secondaryColor icon.color: hovered && enabled ? UserModel.currentUser.accentColor : root.secondaryColor - enabled: root.text !== "" + enabled: root.text !== "" && root.validInput onClicked: root.accepted() }