on xenial help sign in
Add preview columns support, fix spacing, clipping and cacheBuffer in previews.
48e274cMichał Sawicz
qml/Dash/CardFilterGrid.qml+1−1
@@ -20,7 +20,7 @@ import Ubuntu.Components 0.1
20DashFilterGrid {
20DashFilterGrid {
21 id: genericFilterGrid
21 id: genericFilterGrid
22
22
23− minimumHorizontalSpacing: units.gu(0.5)
23+ minimumHorizontalSpacing: units.gu(1)
24 delegateWidth: cardTool.cardWidth
24 delegateWidth: cardTool.cardWidth
25 delegateHeight: cardTool.cardHeight
25 delegateHeight: cardTool.cardHeight
26 verticalSpacing: units.gu(1)
26 verticalSpacing: units.gu(1)
qml/Dash/Previews/Preview.qml+17−3
@@ -54,6 +54,12 @@ Item {
54
54
55 onPreviewModelChanged: processingMouseArea.enabled = false
55 onPreviewModelChanged: processingMouseArea.enabled = false
56
56
57+ Binding {
58+ target: previewModel
59+ property: "widgetColumnCount"
60+ value: row.columns
61+ }
62+
57 MouseArea {
63 MouseArea {
58 anchors.fill: parent
64 anchors.fill: parent
59 }
65 }
@@ -64,19 +70,22 @@ Item {
64 spacing: units.gu(1)
70 spacing: units.gu(1)
65 anchors { fill: parent; margins: spacing }
71 anchors { fill: parent; margins: spacing }
66
72
73+ property int columns: width >= units.gu(80) ? 2 : 1
74+ property real columnWidth: width / columns
75+
67 Repeater {
76 Repeater {
68 model: previewModel
77 model: previewModel
69
78
70 delegate: ListView {
79 delegate: ListView {
71 id: column
80 id: column
72 anchors { top: parent.top; bottom: parent.bottom }
81 anchors { top: parent.top; bottom: parent.bottom }
73− width: row.width
82+ width: row.columnWidth
74 spacing: row.spacing
83 spacing: row.spacing
75 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
84 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
76
85
77 model: columnModel
86 model: columnModel
78 onCountChanged: if (count > 0) root.ready = true
87 onCountChanged: if (count > 0) root.ready = true
79− cacheBuffer: units.gu(40)
88+ cacheBuffer: height
80
89
81 Behavior on contentY { UbuntuNumberAnimation { } }
90 Behavior on contentY { UbuntuNumberAnimation { } }
82
91
@@ -85,7 +94,12 @@ Item {
85 widgetType: model.type
94 widgetType: model.type
86 widgetData: model.properties
95 widgetData: model.properties
87 isCurrentPreview: root.isCurrent
96 isCurrentPreview: root.isCurrent
97+ anchors {
98+ left: parent.left
88− anchors { left: parent.left; right: parent.right }
99+ right: parent.right
100+ leftMargin: units.gu(1)
101+ rightMargin: units.gu(1)
102+ }
89
103
90 onTriggered: {
104 onTriggered: {
91 processingMouseArea.enabled = true;
105 processingMouseArea.enabled = true;
qml/Dash/Previews/PreviewImageGallery.qml+1
@@ -32,6 +32,7 @@ PreviewWidget {
32 orientation: ListView.Horizontal
32 orientation: ListView.Horizontal
33 cacheBuffer: width * 3
33 cacheBuffer: width * 3
34 model: root.widgetData["sources"]
34 model: root.widgetData["sources"]
35+ clip: true
35
36
36 // FIXME: Because of ListViews inside ListViews inside Flickables inside ListViews (and some more)
37 // FIXME: Because of ListViews inside ListViews inside Flickables inside ListViews (and some more)
37 // we finally reached the point where this ListView doesn't correctly get swipe input any more but
38 // we finally reached the point where this ListView doesn't correctly get swipe input any more but