Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u -rf7392d985121b21e9f9814e444b0810cd1d00b18 -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision f7392d985121b21e9f9814e444b0810cd1d00b18) +++ sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -22,65 +22,65 @@ Item { id: _root enum Constants { - TextInputWidth = 350 , - TextInputHeight = 50 , - TextInputLineWidth = 100 + EntryWidth = 350 , + EntryHeight = 40 , + InputWidth = 100 } property alias textInput : _input property alias line : _line property alias label : _label - property alias labelText : _label.text property alias validator : _input.validator - property alias labelVisible : _label.visible + property var nextInput : undefined signal enterPressed() - width : TextEntry.TextInputWidth - height : TextEntry.TextInputHeight + width : _label.width + _input.width + height : TextEntry.EntryHeight - Text { id: _label - anchors { - left: parent.left - top: parent.top + onEnterPressed : { + if (nextInput) { + if (textInput.acceptableInput) { + nextInput.textInput.focus = true + } } - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTextRectExtra } - TextInput { id: _input - anchors { - left: _label.right - } + Text { id : _label + height : parent.height + anchors.left : parent.left + anchors.top : parent.top + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + } - color: acceptableInput ? Colors.textMain : Colors.red - text: "" - font.pixelSize: Fonts.fontPixelTextRectExtra - selectionColor: Colors.borderButtonHalfDarker - height: parent.height - width: Variables.textInputLineWidth - horizontalAlignment: TextInput.AlignHCenter - inputMethodHints: Qt.ImhDigitsOnly - selectedTextColor: acceptableInput ? Colors.textMain : Colors.red - selectByMouse: true - activeFocusOnPress: true - onFocusChanged: { + TextInput { id : _input + 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 + horizontalAlignment : TextInput.AlignHCenter + inputMethodHints : Qt.ImhDigitsOnly + selectByMouse : true + activeFocusOnPress : true + onAccepted : _root.enterPressed() + onFocusChanged : { if (focus) { selectAll() _keyboard.setVisible(true) } } - onAccepted: { - _root.enterPressed() - } } - Line { id: _line - color: Colors.borderButtonHalfDarker - width: Variables.textInputLineWidth - anchors { - top: _input.bottom - left: _input.left - } + Line { id : _line + color : Colors.borderButtonHalfDarker + width : _input.width + anchors.top : _input.bottom + anchors.left: _input.left + anchors.topMargin : -thickness // move it up to be in the container rect in case the TextEntry clip set true. } }