~nick-dedekind/unity8/indicators.hint-interval

« back to all changes in this revision

Viewing changes to qml/Dash/PreviewListView.qml

  • Committer: Nick Dedekind
  • Date: 2014-03-07 15:54:57 UTC
  • mfrom: (638.1.118 unity8)
  • Revision ID: nicholas.dedekind@gmail.com-20140307155457-f0s1zu5ll2czt3rq
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    property alias model: previewListView.model
33
33
    property alias currentIndex: previewListView.currentIndex
34
34
    property alias currentItem: previewListView.currentItem
 
35
    property alias count: previewListView.count
35
36
 
36
37
    Image {
37
38
        objectName: "pointerArrow"
87
88
            id: previewDelegateMapper
88
89
        }
89
90
 
90
 
        onCurrentIndexChanged: {
 
91
        onCurrentIndexChanged: positionListView();
 
92
 
 
93
        function positionListView() {
 
94
            if (!open) {
 
95
                return;
 
96
            }
 
97
 
91
98
            var row = Math.floor(currentIndex / categoryDelegate.columns);
92
99
            if (categoryDelegate.collapsedRowCount <= row) {
93
100
                categoryView.expandedCategoryId = categoryId
94
101
            }
95
102
 
96
 
            if (open) {
97
 
                categoryDelegate.highlightIndex = currentIndex
98
 
            }
 
103
            categoryDelegate.highlightIndex = currentIndex
99
104
 
100
105
            if (!init && model !== undefined) {
101
106
                var item = model.get(currentIndex)
136
141
                onScreen = true;
137
142
                categoryDelegate.highlightIndex = currentIndex;
138
143
                pageHeader.unfocus();
 
144
                positionListView();
139
145
            } else {
140
146
                // Cancel any pending preview requests or actions
141
147
                if (previewListView.currentItem.previewData !== undefined) {