diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-06-16 10:20:41 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-06-16 10:20:41 (GMT) |
commit | 50f4129a2664ed72de899f4477b47f91488c04d9 (patch) | |
tree | a1e02b8553dc741124b449121b6e5c3d01e3ae19 | |
parent | bc4c5a2d9c5d3841948bc4443f2229d8d6ec0e95 (diff) | |
download | Qt-50f4129a2664ed72de899f4477b47f91488c04d9.zip Qt-50f4129a2664ed72de899f4477b47f91488c04d9.tar.gz Qt-50f4129a2664ed72de899f4477b47f91488c04d9.tar.bz2 |
Minor demo fixes
Found some minor demo issues while testing a TextInput change.
-rw-r--r-- | demos/declarative/samegame/samegame.qml | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index 9a721da..9c4bfa8 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -115,6 +115,8 @@ Rectangle { id: nameInputText anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } focus: false + autoScroll: false + maximumLength: 24 onTextChanged: { var newWidth = nameInputText.width + dialogText.width + 40; if ( (newWidth > nameInputDialog.width && newWidth < screen.width) diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml index 69f57c6..e863262 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml @@ -30,13 +30,14 @@ Item { y: 5 //Below function implements all scrolling logic onCursorPositionChanged: { - if(cursorRect.x < leftMargin - textInp.x){//Cursor went off the front - textInp.x = leftMargin - Math.max(0, cursorRect.x); - }else if(cursorRect.x > parent.width - leftMargin - rightMargin - textInp.x){//Cusor went off the end - textInp.x = leftMargin - Math.max(0, cursorRect.x - (parent.width - leftMargin - rightMargin)); + if(cursorRectangle.x < leftMargin - textInp.x){//Cursor went off the front + textInp.x = leftMargin - Math.max(0, cursorRectangle.x); + }else if(cursorRectangle.x > parent.width - leftMargin - rightMargin - textInp.x){//Cusor went off the end + textInp.x = leftMargin - Math.max(0, cursorRectangle.x - (parent.width - leftMargin - rightMargin)); } } + autoScroll: false //It is preferable to implement your own scrolling text:"" horizontalAlignment: TextInput.AlignLeft font.pixelSize:15 |