Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u -r840b91f4f72d599bb523050dda2183a6611017b5 -r2230a5b1b891f47b64165164710aa680ddfc7040 --- sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 840b91f4f72d599bb523050dda2183a6611017b5) +++ sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 2230a5b1b891f47b64165164710aa680ddfc7040) @@ -22,23 +22,21 @@ Item { id: _root enum Constants { - TextInputWidth = 350 , - TextInputHeight = 50 , - TextInputLineWidth = 100 + EntryWidth = 350 , + EntryHeight = 50 , + 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 : TextEntry.EntryWidth + height : TextEntry.EntryHeight onEnterPressed : { if (nextInput) { @@ -48,48 +46,39 @@ } } - Text { id: _label - anchors { - left: parent.left - top: parent.top - } - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTextRectExtra + Text { id : _label + anchors.left : parent.left + anchors.top : parent.top + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra } - TextInput { id: _input - anchors { - left: _label.right - } - - color: acceptableInput ? Colors.textMain : Colors.red - text: "" - font.pixelSize: Fonts.fontPixelTextRectExtra - selectionColor: Colors.borderButtonHalfDarker - height: parent.height - width: TextEntry.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: TextEntry.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 } }