Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u -r6c5b5292ae3b3ebf979175dcb1256c88b1baf90c -rac23b968f565c2beeb153ca2d554b8f868634512 --- sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 6c5b5292ae3b3ebf979175dcb1256c88b1baf90c) +++ sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision ac23b968f565c2beeb153ca2d554b8f868634512) @@ -33,10 +33,12 @@ property alias validator : _input.validator property var nextInput : undefined property alias text : _input.text + property bool hasCarret : false readonly property alias isValid : _input.acceptableInput - signal enterPressed() + signal enterPressed () + signal clicked (var vMouse) width : _label.width + _input.width height : TextEntry.EntryHeight @@ -49,6 +51,15 @@ } } + function doFocus( vFocus ) { + if ( vFocus ) { + if ( ! _root.hasCarret ) { + _input.selectAll() + } + _keyboard.setVisible(true) + } + } + Text { id : _label height : parent.height anchors.left : parent.left @@ -71,12 +82,7 @@ selectByMouse : true activeFocusOnPress : true onAccepted : _root.enterPressed() - onFocusChanged : { - if (focus) { - selectAll() - _keyboard.setVisible(true) - } - } + onFocusChanged : doFocus(focus) } Line { id : _line @@ -86,4 +92,15 @@ anchors.left: _input.left anchors.topMargin : -thickness // move it up to be in the container rect in case the TextEntry clip set true. } + + MouseArea { + visible : ! hasCarret + anchors.fill: parent + propagateComposedEvents: true + onClicked: { + _input.forceActiveFocus() + doFocus(true) + _root.clicked(mouse) + } + } }