From 93c88e8a097d91f1830dce8e0005f2d331ee9726 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 8 Dec 2016 12:22:56 +0100 Subject: [PATCH] unstable --- tests/ui/modules/Common/Form/ListForm.qml | 3 ++- tests/ui/modules/Common/Form/ScrollableTextEdit.qml | 9 ++++----- tests/ui/modules/Common/Form/TextEdit.qml | 4 ++-- tests/ui/views/App/MainWindow/ContactEdit.qml | 4 +++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/ui/modules/Common/Form/ListForm.qml b/tests/ui/modules/Common/Form/ListForm.qml index 83670d0e2..5f18caa73 100644 --- a/tests/ui/modules/Common/Form/ListForm.qml +++ b/tests/ui/modules/Common/Form/ListForm.qml @@ -112,10 +112,11 @@ RowLayout { implicitHeight: textEdit.height width: parent.width - TextEdit { + TextEdit { id: textEdit text: $value + width: 300 height: ListFormStyle.lineHeight onEditingFinished: _handleEditionFinished(index, text) diff --git a/tests/ui/modules/Common/Form/ScrollableTextEdit.qml b/tests/ui/modules/Common/Form/ScrollableTextEdit.qml index 8339dc399..78a874f4c 100644 --- a/tests/ui/modules/Common/Form/ScrollableTextEdit.qml +++ b/tests/ui/modules/Common/Form/ScrollableTextEdit.qml @@ -11,13 +11,13 @@ Item { property alias font: textEdit.font property alias color: textEdit.color - signal editionFinished + signal editingFinished // ----------------------------------------------------------------- - function _handleEditionFinished () { + function _handleEditingFinished () { textEdit.cursorPosition = 0 - editionFinished() + editingFinished() } // ----------------------------------------------------------------- @@ -66,7 +66,6 @@ Item { color: activeFocus && !readOnly ? TextEditStyle.textColor.focused : TextEditStyle.textColor.normal - padding: ListFormStyle.value.text.padding selectByMouse: true width: flick.width wrapMode: Text.Wrap @@ -75,7 +74,7 @@ Item { Keys.onReturnPressed: focus = false onCursorRectangleChanged: flick._ensureVisible(cursorRectangle) - onEditingFinished: _handleEditionFinished() + onEditingFinished: _handleEditingFinished() } } } diff --git a/tests/ui/modules/Common/Form/TextEdit.qml b/tests/ui/modules/Common/Form/TextEdit.qml index 90e2cf4e4..b4e0f22e2 100644 --- a/tests/ui/modules/Common/Form/TextEdit.qml +++ b/tests/ui/modules/Common/Form/TextEdit.qml @@ -5,16 +5,16 @@ import Common.Styles 1.0 // =================================================================== -TextEdit { +TextInput { id: textEdit + clip: true color: activeFocus && !readOnly ? TextEditStyle.textColor.focused : TextEditStyle.textColor.normal padding: ListFormStyle.value.text.padding selectByMouse: true verticalAlignment: TextEdit.AlignVCenter - wrapMode: Text.Wrap Keys.onEscapePressed: focus = false Keys.onReturnPressed: focus = false diff --git a/tests/ui/views/App/MainWindow/ContactEdit.qml b/tests/ui/views/App/MainWindow/ContactEdit.qml index 567f5f407..718e19f50 100644 --- a/tests/ui/views/App/MainWindow/ContactEdit.qml +++ b/tests/ui/views/App/MainWindow/ContactEdit.qml @@ -111,8 +111,10 @@ ColumnLayout { text: avatar.username - onEditionFinished: { + onEditingFinished: { _contact.username = text + + // Update current text with new username. text = _contact.username } }