on xenial help sign in
Add preview columns support, fix spacing, clipping and cacheBuffer in previews.
commit48e274c598fd34daceee1175a1748b1b1916b1d0 authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 20 Feb 2014, 11:58 (13 years ago) parent9316aa3
3 files changed+19−4
qml/Dash/CardFilterGrid.qml+1−1 qml/Dash/Previews/Preview.qml+17−3 qml/Dash/Previews/PreviewImageGallery.qml+1
qml/Dash/CardFilterGrid.qml+1−1
@@ -20,7 +20,7 @@ import Ubuntu.Components 0.1
2020DashFilterGrid {
2121 id: genericFilterGrid
2222
23− minimumHorizontalSpacing: units.gu(0.5)
23+ minimumHorizontalSpacing: units.gu(1)
2424 delegateWidth: cardTool.cardWidth
2525 delegateHeight: cardTool.cardHeight
2626 verticalSpacing: units.gu(1)
qml/Dash/Previews/Preview.qml+17−3
@@ -54,6 +54,12 @@ Item {
5454
5555 onPreviewModelChanged: processingMouseArea.enabled = false
5656
57+ Binding {
58+ target: previewModel
59+ property: "widgetColumnCount"
60+ value: row.columns
61+ }
62+
5763 MouseArea {
5864 anchors.fill: parent
5965 }
@@ -64,19 +70,22 @@ Item {
6470 spacing: units.gu(1)
6571 anchors { fill: parent; margins: spacing }
6672
73+ property int columns: width >= units.gu(80) ? 2 : 1
74+ property real columnWidth: width / columns
75+
6776 Repeater {
6877 model: previewModel
6978
7079 delegate: ListView {
7180 id: column
7281 anchors { top: parent.top; bottom: parent.bottom }
73− width: row.width
82+ width: row.columnWidth
7483 spacing: row.spacing
7584 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
7685
7786 model: columnModel
7887 onCountChanged: if (count > 0) root.ready = true
79− cacheBuffer: units.gu(40)
88+ cacheBuffer: height
8089
8190 Behavior on contentY { UbuntuNumberAnimation { } }
8291
@@ -85,7 +94,12 @@ Item {
8594 widgetType: model.type
8695 widgetData: model.properties
8796 isCurrentPreview: root.isCurrent
88− anchors { left: parent.left; right: parent.right }
97+ anchors {
98+ left: parent.left
99+ right: parent.right
100+ leftMargin: units.gu(1)
101+ rightMargin: units.gu(1)
102+ }
89103
90104 onTriggered: {
91105 processingMouseArea.enabled = true;
qml/Dash/Previews/PreviewImageGallery.qml+1
@@ -32,6 +32,7 @@ PreviewWidget {
3232 orientation: ListView.Horizontal
3333 cacheBuffer: width * 3
3434 model: root.widgetData["sources"]
35+ clip: true
3536
3637 // FIXME: Because of ListViews inside ListViews inside Flickables inside ListViews (and some more)
3738 // we finally reached the point where this ListView doesn't correctly get swipe input any more but