@@ -63,22 +63,7 @@ Item {
63 Repeater {
63 Repeater {
64 id: repeater;
64 id: repeater;
65 model: previewModel
65 model: previewModel
67− function findChild(obj, objectName) {
68− var childs = new Array(0);
70− while (childs.length > 0) {
71− if (childs[0].objectName === objectName) {
74− for (var i in childs[0].data) {
75− childs.push(childs[0].data[i])
82 delegate: ListView {
67 delegate: ListView {
83 id: column
68 id: column
84 objectName: "previewListRow" + index
69 objectName: "previewListRow" + index
@@ -86,40 +71,6 @@ Item {
86 width: row.columnWidth
71 width: row.columnWidth
87 spacing: row.spacing
72 spacing: row.spacing
88 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
73 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
90− readonly property int inputMethodMargin: 30;
91− property bool inputMethodVisible: Qt.inputMethod.visible;
92− onInputMethodVisibleChanged: {
93− if (!inputMethodVisible)
97− var contentItem = column.contentItem;
99− var reviewTextArea = repeater.findChild(contentItem, "reviewTextArea");
100− if (reviewTextArea !== null && reviewTextArea.activeFocus) {
101− textArea = reviewTextArea;
104− if (textArea === null) {
105− var commentTextArea = repeater.findChild(contentItem, "commentTextArea");
106− if (commentTextArea !== null && commentTextArea.activeFocus) {
107− textArea = commentTextArea;
111− if (textArea === null)
114− var textAreaPos = textArea.mapToItem(column, 0, 0);
115− var textAreaGlobalHeight = textAreaPos.y + textArea.implicitHeight
116− + column.height / 2.0;
118− if (textAreaGlobalHeight > column.height) {
119− column.contentY += textAreaGlobalHeight - column.height + inputMethodMargin;
123 model: columnModel
74 model: columnModel
124 cacheBuffer: height
75 cacheBuffer: height
@@ -131,6 +82,8 @@ Item {
131 widgetData: model.properties
82 widgetData: model.properties
132 isCurrentPreview: root.isCurrent
83 isCurrentPreview: root.isCurrent
133 scopeStyle: root.scopeStyle
84 scopeStyle: root.scopeStyle
85+ readonly property int inputMethodMargin: units.gu(2);
134 anchors {
87 anchors {
135 left: parent.left
88 left: parent.left
136 right: parent.right
89 right: parent.right
@@ -141,6 +94,16 @@ Item {
141 onTriggered: {
94 onTriggered: {
142 previewModel.triggered(widgetId, actionId, data);
95 previewModel.triggered(widgetId, actionId, data);
99+ var textAreaPos = item.mapToItem(column, 0, 0);
100+ var textAreaGlobalHeight = textAreaPos.y + item.implicitHeight
101+ + column.height / 2.0;
103+ if (textAreaGlobalHeight > column.height) {
104+ column.contentY += textAreaGlobalHeight - column.height + inputMethodMargin;
145 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
108 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)