on xenial help sign in
Use PreviewStack and per-column widget models
5ccacb1Michal Hruby
qml/Dash/PreviewListView.qml+2−1
@@ -100,7 +100,8 @@ Item {
100
100
101 if (model !== undefined) {
101 if (model !== undefined) {
102 var item = model.get(currentIndex)
102 var item = model.get(currentIndex)
103− previewListView.currentItem.previewModel = scope.preview(item.result)
103+ var previewStack = scope.preview(item.result)
104+ previewListView.currentItem.previewModel = previewStack.get(0)
104 }
105 }
105
106
106 // Adjust contentY in case we need to change to it to show the next row
107 // Adjust contentY in case we need to change to it to show the next row
qml/Dash/Previews/Preview.qml+2−2
@@ -65,7 +65,7 @@ Item {
65 anchors { fill: parent; margins: spacing }
65 anchors { fill: parent; margins: spacing }
66
66
67 Repeater {
67 Repeater {
68− model: 1
68+ model: previewModel
69
69
70 delegate: ListView {
70 delegate: ListView {
71 id: column
71 id: column
@@ -74,7 +74,7 @@ Item {
74 spacing: row.spacing
74 spacing: row.spacing
75 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
75 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
76
76
77− model: previewModel
77+ model: columnModel
78 onCountChanged: if (count > 0) root.ready = true
78 onCountChanged: if (count > 0) root.ready = true
79 cacheBuffer: units.gu(40)
79 cacheBuffer: units.gu(40)
80
80