@@ -63,22 +63,7 @@ Item {
6363 Repeater {
6464 id: repeater;
6565 model: previewModel
66−
67− function findChild(obj, objectName) {
68− var childs = new Array(0);
69− childs.push(obj)
70− while (childs.length > 0) {
71− if (childs[0].objectName === objectName) {
72− return childs[0]
73− }
74− for (var i in childs[0].data) {
75− childs.push(childs[0].data[i])
76− }
77− childs.splice(0, 1);
78− }
79− return null;
80− }
81−
66+
8267 delegate: ListView {
8368 id: column
8469 objectName: "previewListRow" + index
@@ -86,40 +71,6 @@ Item {
8671 width: row.columnWidth
8772 spacing: row.spacing
8873 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
89−
90− readonly property int inputMethodMargin: 30;
91− property bool inputMethodVisible: Qt.inputMethod.visible;
92− onInputMethodVisibleChanged: {
93− if (!inputMethodVisible)
94− return;
95−
96− var textArea = null;
97− var contentItem = column.contentItem;
98−
99− var reviewTextArea = repeater.findChild(contentItem, "reviewTextArea");
100− if (reviewTextArea !== null && reviewTextArea.activeFocus) {
101− textArea = reviewTextArea;
102− }
103−
104− if (textArea === null) {
105− var commentTextArea = repeater.findChild(contentItem, "commentTextArea");
106− if (commentTextArea !== null && commentTextArea.activeFocus) {
107− textArea = commentTextArea;
108− }
109− }
110−
111− if (textArea === null)
112− return;
113−
114− var textAreaPos = textArea.mapToItem(column, 0, 0);
115− var textAreaGlobalHeight = textAreaPos.y + textArea.implicitHeight
116− + column.height / 2.0;
117−
118− if (textAreaGlobalHeight > column.height) {
119− column.contentY += textAreaGlobalHeight - column.height + inputMethodMargin;
120− }
121− }
122−
12374 model: columnModel
12475 cacheBuffer: height
12576
@@ -131,6 +82,8 @@ Item {
13182 widgetData: model.properties
13283 isCurrentPreview: root.isCurrent
13384 scopeStyle: root.scopeStyle
85+ readonly property int inputMethodMargin: units.gu(2);
86+
13487 anchors {
13588 left: parent.left
13689 right: parent.right
@@ -141,6 +94,16 @@ Item {
14194 onTriggered: {
14295 previewModel.triggered(widgetId, actionId, data);
14396 }
97+
98+ onMakeSureVisible: {
99+ var textAreaPos = item.mapToItem(column, 0, 0);
100+ var textAreaGlobalHeight = textAreaPos.y + item.implicitHeight
101+ + column.height / 2.0;
102+
103+ if (textAreaGlobalHeight > column.height) {
104+ column.contentY += textAreaGlobalHeight - column.height + inputMethodMargin;
105+ }
106+ }
144107
145108 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
146109