@@ -61,16 +61,31 @@ Item {
61 property real columnWidth: width / columns
61 property real columnWidth: width / columns
63 Repeater {
63 Repeater {
65 model: previewModel
64 model: previewModel
67 delegate: ListView {
66 delegate: ListView {
68 id: column
67 id: column
69 objectName: "previewListRow" + index
68 objectName: "previewListRow" + index
70− anchors { top: parent.top; bottom: parent.bottom }
71+ bottom: parent.bottom
72+ bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
71 width: row.columnWidth
74 width: row.columnWidth
72 spacing: row.spacing
75 spacing: row.spacing
73− bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
76+ property var makeSureVisibleItem
77+ property real previousVisibleHeight: 0
78+ property real visibleHeight: height - bottomMargin
79+ onVisibleHeightChanged: {
80+ if (makeSureVisibleItem && makeSureVisibleItem.activeFocus && previousVisibleHeight > visibleHeight) {
81+ var textAreaPos = makeSureVisibleItem.mapToItem(column, 0, 0);
82+ if (textAreaPos.y + makeSureVisibleItem.height > column.visibleHeight) {
83+ column.contentY += textAreaPos.y + makeSureVisibleItem.height - column.visibleHeight
86+ previousVisibleHeight = visibleHeight;
74 model: columnModel
89 model: columnModel
75 cacheBuffer: height
90 cacheBuffer: height
@@ -82,8 +97,6 @@ Item {
82 widgetData: model.properties
97 widgetData: model.properties
83 isCurrentPreview: root.isCurrent
98 isCurrentPreview: root.isCurrent
84 scopeStyle: root.scopeStyle
99 scopeStyle: root.scopeStyle
85− readonly property int inputMethodMargin: units.gu(2);
87 anchors {
100 anchors {
88 left: parent.left
101 left: parent.left
89 right: parent.right
102 right: parent.right
@@ -94,16 +107,10 @@ Item {
94 onTriggered: {
107 onTriggered: {
95 previewModel.triggered(widgetId, actionId, data);
108 previewModel.triggered(widgetId, actionId, data);
98− onMakeSureVisible: {
110+ onMakeSureVisible: {
99− var textAreaPos = item.mapToItem(column, 0, 0);
111+ column.previousVisibleHeight=column.visibleHeight
100− var textAreaGlobalHeight = textAreaPos.y + item.implicitHeight
112+ column.makeSureVisibleItem=item
101− + column.height / 2.0;
103− if (textAreaGlobalHeight > column.height) {
104− column.contentY += textAreaGlobalHeight - column.height + inputMethodMargin;
108 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
115 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)