on xenial help sign in
More work...
commit3be26893bc34cd393d631f4d1e53f0d674c13760 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 21 Nov 2013, 10:40 (13 years ago) parentecef835
4 files changed+24−18
Dash/DashCarousel.qml+2−3 Dash/DashFilterGrid.qml+4−3 Dash/DashRenderer.qml+15−9 Dash/GenericScopeView.qml+3−3
Dash/DashCarousel.qml+2−3
@@ -27,11 +27,9 @@ DashRenderer {
2727 property alias selectedItemScaleFactor: carousel.selectedItemScaleFactor
2828 property alias tileAspectRatio: carousel.tileAspectRatio
2929
30− collapsedHeight: carousel.height
3130 currentItem: carousel.currentItem
32− highlightIndex: carousel.highlightIndex
3331 height: carousel.implicitHeight + units.gu(6)
34− uncollapsedHeight: carousel.height
32+ verticalSpacing: units.gu(3)
3533
3634 Carousel {
3735 id: carousel
@@ -41,6 +39,7 @@ DashRenderer {
4139 selectedItemScaleFactor: 1.14
4240 cacheBuffer: 1404 // 18px * 13gu * 6
4341 model: dashCarousel.model
42+ highlightIndex: dashCarousel.highlightIndex
4443
4544 onClicked: dashCarousel.clicked(index, model, itemY)
4645 onPressAndHold: dashCarousel.pressAndHold(index, model, itemY)
Dash/DashFilterGrid.qml+4−3
@@ -23,23 +23,23 @@ DashRenderer {
2323
2424 property alias cellWidth: filterGrid.cellWidth
2525 property alias cellHeight: filterGrid.cellHeight
26− property alias columns: filterGrid.columns
2726 property alias delegate: filterGrid.delegate
2827 property alias delegateWidth: filterGrid.delegateWidth
2928 property alias delegateHeight: filterGrid.delegateHeight
3029 property alias maximumNumberOfColumns: filterGrid.maximumNumberOfColumns
3130 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
32− property alias verticalSpacing: filterGrid.verticalSpacing
3331
3432 collapsedHeight: filterGrid.collapsedHeight
33+ collapsedRowCount: filterGrid.collapsedRowCount
34+ columns: filterGrid.columns
3535 currentItem: filterGrid.currentItem
3636 expandable: filterGrid.expandable
3737 delegateCreationBegin: filterGrid.delegateCreationBegin
3838 delegateCreationEnd: filterGrid.delegateCreationEnd
39− highlightIndex: filterGrid.highlightIndex
4039 implicitHeight: filterGrid.implicitHeight
4140 margins: filterGrid.margins
4241 uncollapsedHeight: filterGrid.uncollapsedHeight
42+ verticalSpacing: filterGrid.verticalSpacing
4343
4444 function startFilterAnimation(filter) {
4545 filterGrid.startFilterAnimation(filter)
@@ -54,5 +54,6 @@ DashRenderer {
5454 verticalSpacing: units.gu(2)
5555 model: dashFilterGrid.model
5656 filter: dashFilterGrid.filter
57+ highlightIndex: dashFilterGrid.highlightIndex
5758 }
5859}
Dash/DashRenderer.qml+15−9
@@ -23,25 +23,31 @@ Item {
2323 // In case it can be expanded, should we filter it
2424 property bool filter: true
2525
26− // Index of the highlighted item
27− property int highlightIndex: 0
26+ property int collapsedRowCount: 1
2827
29− property int margins: 0
28+ property int collapsedHeight: height
3029
31− // The current item of the renderer
32− property var currentItem
30+ property int columns: 1
3331
34− // The model to renderer
35− property var model
32+ // Index of the highlighted item
33+ property int highlightIndex: -1
3634
37− property int collapsedHeight
35+ property int margins: 0
3836
39− property int uncollapsedHeight
37+ property int uncollapsedHeight: height
4038
4139 property real delegateCreationBegin
4240
4341 property real delegateCreationEnd
4442
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+
4551 /// Emitted when the user clicked on an item
4652 /// @param index is the index of the clicked item
4753 /// @param model is the model of all the items
Dash/GenericScopeView.qml+3−3
@@ -398,10 +398,10 @@ ScopeView {
398398
399399 if (!init && model !== undefined) {
400400 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)
402402 }
403403
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
405405 var newContentY = itemY - effect.positionPx - categoryDelegate.verticalSpacing;
406406 var effectAdjust = effect.positionPx;
407407 if (newContentY < 0) {
@@ -491,7 +491,7 @@ ScopeView {
491491 }
492492
493493 function closePreviewSpinner() {
494− if(item) {
494+ if (item) {
495495 item.showProcessingAction = false;
496496 }
497497 }