Merge lp:~fboucault/unity-2d/renderer_grid_limit_count into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Florian Boucault
Approved revision: 626
Merged at revision: 649
Proposed branch: lp:~fboucault/unity-2d/renderer_grid_limit_count
Merge into: lp:unity-2d/3.0
Diff against target: 52 lines (+12/-10)
1 file modified
places/RendererGrid.qml (+12/-10)
To merge this branch: bzr merge lp:~fboucault/unity-2d/renderer_grid_limit_count
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+69449@code.launchpad.net

Description of the change

[dash] RendererGrid: actually filter out the items that are not displayed because of group folding.

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Looks fine, accept.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/RendererGrid.qml'
2--- places/RendererGrid.qml 2011-06-23 17:08:53 +0000
3+++ places/RendererGrid.qml 2011-07-27 12:38:23 +0000
4@@ -47,18 +47,18 @@
5 /* Using results.contentHeight produces binding loop warnings and potential
6 rendering issues. We compute the height manually.
7 */
8- /* FIXME: tricking the system by making the delegate of height 0 and with
9- an invisible header is no good: the item in the model still
10- exists and some things such as keyboard selection break.
11+ /* FIXME: tricking the system by making the delegate of height 0 and invisible
12+ is no good: the item in the model still exists and some things
13+ such as keyboard selection break.
14 */
15- height: results.count > 0 ? header.height + results_layout.anchors.topMargin + results.totalHeight : 0
16+ visible: results.model.totalCount > 0
17+ height: visible ? header.height + results_layout.anchors.topMargin + results.totalHeight : 0
18 //Behavior on height {NumberAnimation {duration: 200}}
19
20 GroupHeader {
21 id: header
22
23- visible: results.count > 0
24- availableCount: results.count - results.cellsPerRow
25+ availableCount: results.model.totalCount - results.cellsPerRow
26 folded: parent.folded
27 anchors.top: parent.top
28 anchors.left: parent.left
29@@ -124,9 +124,7 @@
30 width: flickable.width
31 height: Math.min(totalHeight, flickable.height)
32
33- /* Only display one line of items when folded */
34- property int displayedCount: folded ? cellsPerRow : count
35- property int totalHeight: results.cellHeight*Math.ceil(displayedCount/cellsPerRow)
36+ property int totalHeight: results.cellHeight*Math.ceil(count/cellsPerRow)
37
38 minHorizontalSpacing: renderer.horizontalSpacing
39 minVerticalSpacing: renderer.verticalSpacing
40@@ -168,7 +166,11 @@
41 }
42 }
43
44- model: renderer.model
45+ /* Only display one line of items when folded */
46+ model: SortFilterProxyModel {
47+ model: renderer.model != undefined ? renderer.model : null
48+ limit: folded ? results.cellsPerRow : -1
49+ }
50 }
51 }
52 }

Subscribers

People subscribed via source and target branches