Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u -rac23b968f565c2beeb153ca2d554b8f868634512 -r559dc64d12cf7647ec8c29ccbf4ca90f90e5e3a2 --- sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision ac23b968f565c2beeb153ca2d554b8f868634512) +++ sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 559dc64d12cf7647ec8c29ccbf4ca90f90e5e3a2) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file TextEntry.qml - * \author (last) Peter Lucia - * \date (last) 07-Jan-2021 - * \author (original) Peter Lucia - * \date (original) 07-Jan-2021 + * \file TextEntry.qml + * \author (last) Behrouz NematiPour + * \date (last) 02-Apr-2023 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 * */ @@ -30,10 +30,11 @@ property alias textInput : _input property alias line : _line property alias label : _label + property alias separator : _separator property alias validator : _input.validator property var nextInput : undefined property alias text : _input.text - property bool hasCarret : false + property bool hasCursor : true readonly property alias isValid : _input.acceptableInput @@ -53,7 +54,7 @@ function doFocus( vFocus ) { if ( vFocus ) { - if ( ! _root.hasCarret ) { + if ( ! _root.hasCursor ) { _input.selectAll() } _keyboard.setVisible(true) @@ -68,15 +69,28 @@ font.pixelSize : Fonts.fontPixelTextRectExtra } + Text { id : _separator + visible : text + width : 0 + text : "" + height : parent.height + anchors.left : _label.right + anchors.top : parent.top + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + horizontalAlignment: Text.AlignLeft + } + TextInput { id : _input + enabled : hasCursor height : parent.height width : TextEntry.InputWidth text : "" font.pixelSize : Fonts.fontPixelTextRectExtra color : acceptableInput ? Colors.textMain : Colors.red selectionColor : Colors.borderButtonHalfDarker selectedTextColor : acceptableInput ? Colors.textMain : Colors.red - anchors.left : _label.right + anchors.left : _separator.right horizontalAlignment : TextInput.AlignHCenter inputMethodHints : Qt.ImhDigitsOnly selectByMouse : true @@ -86,6 +100,7 @@ } Line { id : _line + visible : hasCursor color : Colors.borderButtonHalfDarker width : _input.width anchors.top : _input.bottom @@ -94,7 +109,7 @@ } MouseArea { - visible : ! hasCarret + visible : ! hasCursor anchors.fill: parent propagateComposedEvents: true onClicked: {