on xenial help sign in
More work...
3be2689Andrea Cimitan
Dash/DashCarousel.qml+2−3
@@ -27,11 +27,9 @@ DashRenderer {
27 property alias selectedItemScaleFactor: carousel.selectedItemScaleFactor
27 property alias selectedItemScaleFactor: carousel.selectedItemScaleFactor
28 property alias tileAspectRatio: carousel.tileAspectRatio
28 property alias tileAspectRatio: carousel.tileAspectRatio
29
29
30− collapsedHeight: carousel.height
31 currentItem: carousel.currentItem
30 currentItem: carousel.currentItem
32− highlightIndex: carousel.highlightIndex
33 height: carousel.implicitHeight + units.gu(6)
31 height: carousel.implicitHeight + units.gu(6)
34− uncollapsedHeight: carousel.height
32+ verticalSpacing: units.gu(3)
35
33
36 Carousel {
34 Carousel {
37 id: carousel
35 id: carousel
@@ -41,6 +39,7 @@ DashRenderer {
41 selectedItemScaleFactor: 1.14
39 selectedItemScaleFactor: 1.14
42 cacheBuffer: 1404 // 18px * 13gu * 6
40 cacheBuffer: 1404 // 18px * 13gu * 6
43 model: dashCarousel.model
41 model: dashCarousel.model
42+ highlightIndex: dashCarousel.highlightIndex
44
43
45 onClicked: dashCarousel.clicked(index, model, itemY)
44 onClicked: dashCarousel.clicked(index, model, itemY)
46 onPressAndHold: dashCarousel.pressAndHold(index, model, itemY)
45 onPressAndHold: dashCarousel.pressAndHold(index, model, itemY)
Dash/DashFilterGrid.qml+4−3
@@ -23,23 +23,23 @@ DashRenderer {
23
23
24 property alias cellWidth: filterGrid.cellWidth
24 property alias cellWidth: filterGrid.cellWidth
25 property alias cellHeight: filterGrid.cellHeight
25 property alias cellHeight: filterGrid.cellHeight
26− property alias columns: filterGrid.columns
27 property alias delegate: filterGrid.delegate
26 property alias delegate: filterGrid.delegate
28 property alias delegateWidth: filterGrid.delegateWidth
27 property alias delegateWidth: filterGrid.delegateWidth
29 property alias delegateHeight: filterGrid.delegateHeight
28 property alias delegateHeight: filterGrid.delegateHeight
30 property alias maximumNumberOfColumns: filterGrid.maximumNumberOfColumns
29 property alias maximumNumberOfColumns: filterGrid.maximumNumberOfColumns
31 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
30 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
32− property alias verticalSpacing: filterGrid.verticalSpacing
33
31
34 collapsedHeight: filterGrid.collapsedHeight
32 collapsedHeight: filterGrid.collapsedHeight
33+ collapsedRowCount: filterGrid.collapsedRowCount
34+ columns: filterGrid.columns
35 currentItem: filterGrid.currentItem
35 currentItem: filterGrid.currentItem
36 expandable: filterGrid.expandable
36 expandable: filterGrid.expandable
37 delegateCreationBegin: filterGrid.delegateCreationBegin
37 delegateCreationBegin: filterGrid.delegateCreationBegin
38 delegateCreationEnd: filterGrid.delegateCreationEnd
38 delegateCreationEnd: filterGrid.delegateCreationEnd
39− highlightIndex: filterGrid.highlightIndex
40 implicitHeight: filterGrid.implicitHeight
39 implicitHeight: filterGrid.implicitHeight
41 margins: filterGrid.margins
40 margins: filterGrid.margins
42 uncollapsedHeight: filterGrid.uncollapsedHeight
41 uncollapsedHeight: filterGrid.uncollapsedHeight
42+ verticalSpacing: filterGrid.verticalSpacing
43
43
44 function startFilterAnimation(filter) {
44 function startFilterAnimation(filter) {
45 filterGrid.startFilterAnimation(filter)
45 filterGrid.startFilterAnimation(filter)
@@ -54,5 +54,6 @@ DashRenderer {
54 verticalSpacing: units.gu(2)
54 verticalSpacing: units.gu(2)
55 model: dashFilterGrid.model
55 model: dashFilterGrid.model
56 filter: dashFilterGrid.filter
56 filter: dashFilterGrid.filter
57+ highlightIndex: dashFilterGrid.highlightIndex
57 }
58 }
58}
59}
Dash/DashRenderer.qml+15−9
@@ -23,25 +23,31 @@ Item {
23 // In case it can be expanded, should we filter it
23 // In case it can be expanded, should we filter it
24 property bool filter: true
24 property bool filter: true
25
25
26− // Index of the highlighted item
27− property int highlightIndex: 0
26+ property int collapsedRowCount: 1
28
27
29− property int margins: 0
28+ property int collapsedHeight: height
30
29
31− // The current item of the renderer
30+ property int columns: 1
32− property var currentItem
33
31
34− // The model to renderer
32+ // Index of the highlighted item
35− property var model
33+ property int highlightIndex: -1
36
34
37− property int collapsedHeight
35+ property int margins: 0
38
36
39− property int uncollapsedHeight
37+ property int uncollapsedHeight: height
40
38
41 property real delegateCreationBegin
39 property real delegateCreationBegin
42
40
43 property real delegateCreationEnd
41 property real delegateCreationEnd
44
42
43+ property real verticalSpacing: 0
44+
45+ // The current item of the renderer
46+ property var currentItem
47+
48+ // The model to renderer
49+ property var model
50+
45 /// Emitted when the user clicked on an item
51 /// Emitted when the user clicked on an item
46 /// @param index is the index of the clicked item
52 /// @param index is the index of the clicked item
47 /// @param model is the model of all the items
53 /// @param model is the model of all the items
Dash/GenericScopeView.qml+3−3
@@ -398,10 +398,10 @@ ScopeView {
398
398
399 if (!init && model !== undefined) {
399 if (!init && model !== undefined) {
400 var item = model.get(currentIndex)
400 var item = model.get(currentIndex)
401− scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
401+ scopeView.scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
402 }
402 }
403
403
404− var itemY = categoryView.contentItem.mapFromItem(categoryDelegate.currentItem).y;
404+ var itemY = categoryView.contentItem.mapFromItem(categoryDelegate.currentItem).y; //XXX not working fine with carousel, shift in y after first
405 var newContentY = itemY - effect.positionPx - categoryDelegate.verticalSpacing;
405 var newContentY = itemY - effect.positionPx - categoryDelegate.verticalSpacing;
406 var effectAdjust = effect.positionPx;
406 var effectAdjust = effect.positionPx;
407 if (newContentY < 0) {
407 if (newContentY < 0) {
@@ -491,7 +491,7 @@ ScopeView {
491 }
491 }
492
492
493 function closePreviewSpinner() {
493 function closePreviewSpinner() {
494− if(item) {
494+ if (item) {
495 item.showProcessingAction = false;
495 item.showProcessingAction = false;
496 }
496 }
497 }
497 }