Merge lp:~aacid/unity8/categoryDelegateRangeFixOvershootDetection into lp:unity8

Proposed by Albert Astals Cid
Status: Superseded
Proposed branch: lp:~aacid/unity8/categoryDelegateRangeFixOvershootDetection
Merge into: lp:unity8
Diff against target: 96 lines (+22/-14)
5 files modified
qml/Components/FilterGrid.qml (+1/-0)
qml/Components/ResponsiveGridView.qml (+1/-0)
qml/Dash/CardFilterGrid.qml (+1/-0)
qml/Dash/DashRenderer.qml (+2/-0)
qml/Dash/GenericScopeView.qml (+17/-14)
To merge this branch: bzr merge lp:~aacid/unity8/categoryDelegateRangeFixOvershootDetection
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+212892@code.launchpad.net

This proposal has been superseded by a proposal from 2014-04-08.

Commit message

CategoryDelegateRange: Fix condition for detecting overshooting

Description of the change

This is hard to autotest since what was happening is that all the delegates where being created and then immediately destroyed, so at the end the number of delegates we'd have in a tryCompare would be the same.

For manually testing this:
 * Add to Card.qml root
+ Component.onCompleted: console.log("Created", root)
+ Component.onDestruction: console.log("Destroyed", root)
 * And then start the shell and uncollapse the Available category of the Apps scope

Without it you'll see that there's lots of created and destroyed, without it there's only a few created.

* Are there any related MPs required for this MP to build/function as expected?
No

* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

* If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:785
http://jenkins.qa.ubuntu.com/job/unity8-ci/2641/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4273
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3858
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1511
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1162
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1166
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1166/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1162
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3700
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4357
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4357/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3860
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3860/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6139
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5231

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2641/rebuild

review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

 Yes. Everything still works. The code change makes sense to me.

 * Did CI run pass? If not, please explain why.

Yip

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

Just realzied a bug in here

786. By Albert Astals Cid

Merge lp:~aacid/unity8/delegateRangeNeedsOriginY

787. By Albert Astals Cid

More overshoot check fixes

 * Only do the overshoot checks if we are moving
 * The "real" content height is not contentHeight but contentHeight - originY

788. By Albert Astals Cid

Fixes

789. By Albert Astals Cid

Merge

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/FilterGrid.qml'
2--- qml/Components/FilterGrid.qml 2014-01-29 13:35:40 +0000
3+++ qml/Components/FilterGrid.qml 2014-04-08 13:51:08 +0000
4@@ -59,6 +59,7 @@
5 property alias cellHeight: iconTileGrid.cellHeight
6 property alias delegateCreationBegin: iconTileGrid.delegateCreationBegin
7 property alias delegateCreationEnd: iconTileGrid.delegateCreationEnd
8+ readonly property alias originY: iconTileGrid.originY
9 readonly property alias flicking: iconTileGrid.flicking
10 readonly property alias moving: iconTileGrid.moving
11 readonly property alias pressDelay: iconTileGrid.pressDelay
12
13=== modified file 'qml/Components/ResponsiveGridView.qml'
14--- qml/Components/ResponsiveGridView.qml 2014-02-21 11:08:42 +0000
15+++ qml/Components/ResponsiveGridView.qml 2014-04-08 13:51:08 +0000
16@@ -40,6 +40,7 @@
17 readonly property alias flicking: gridView.flicking
18 readonly property alias moving: gridView.moving
19 readonly property alias pressDelay: gridView.pressDelay
20+ readonly property alias originY: gridView.originY
21 property alias delegateCreationBegin: gridView.delegateCreationBegin
22 property alias delegateCreationEnd: gridView.delegateCreationEnd
23 property alias highlightIndex: gridView.highlightIndex
24
25=== modified file 'qml/Dash/CardFilterGrid.qml'
26--- qml/Dash/CardFilterGrid.qml 2014-03-26 15:09:25 +0000
27+++ qml/Dash/CardFilterGrid.qml 2014-04-08 13:51:08 +0000
28@@ -24,6 +24,7 @@
29 collapsedHeight: filterGrid.collapsedHeight
30 margins: filterGrid.margins
31 uncollapsedHeight: filterGrid.uncollapsedHeight
32+ originY: filterGrid.originY
33 verticalSpacing: units.gu(1)
34 currentItem: filterGrid.currentItem
35 height: filterGrid.height
36
37=== modified file 'qml/Dash/DashRenderer.qml'
38--- qml/Dash/DashRenderer.qml 2014-03-26 15:09:25 +0000
39+++ qml/Dash/DashRenderer.qml 2014-04-08 13:51:08 +0000
40@@ -33,6 +33,8 @@
41
42 property var delegateCreationEnd: undefined
43
44+ property real originY: 0
45+
46 property real verticalSpacing: 0
47
48 // The current item of the renderer
49
50=== modified file 'qml/Dash/GenericScopeView.qml'
51--- qml/Dash/GenericScopeView.qml 2014-04-01 22:56:21 +0000
52+++ qml/Dash/GenericScopeView.qml 2014-04-08 13:51:08 +0000
53@@ -237,26 +237,29 @@
54 }
55
56 function updateDelegateCreationRange() {
57- // Do not update the range if we are overshooting up or down, since we'll come back
58- // to the stable position and delete/create items without any reason
59- if (categoryView.contentY < categoryView.originY) {
60- return;
61- } else if (categoryView.contentY + categoryView.height > categoryView.contentHeight) {
62- return;
63+ if (moving) {
64+ // Do not update the range if we are overshooting up or down, since we'll come back
65+ // to the stable position and delete/create items without any reason
66+ if (categoryView.contentY < categoryView.originY) {
67+ return;
68+ } else if (categoryView.originY + categoryView.contentHeight > categoryView.height &&
69+ categoryView.contentY + categoryView.height > categoryView.contentHeight) {
70+ return;
71+ }
72 }
73
74 if (item && item.hasOwnProperty("delegateCreationBegin")) {
75 if (baseItem.y + baseItem.height <= 0) {
76- // Not visible (item at top of the list)
77- item.delegateCreationBegin = baseItem.height
78- item.delegateCreationEnd = baseItem.height
79+ // Not visible (item at top of the list viewport)
80+ item.delegateCreationBegin = item.originY + baseItem.height
81+ item.delegateCreationEnd = item.originY + baseItem.height
82 } else if (baseItem.y >= categoryView.height) {
83- // Not visible (item at bottom of the list)
84- item.delegateCreationBegin = 0
85- item.delegateCreationEnd = 0
86+ // Not visible (item at bottom of the list viewport)
87+ item.delegateCreationBegin = item.originY
88+ item.delegateCreationEnd = item.originY
89 } else {
90- item.delegateCreationBegin = Math.max(-baseItem.y, 0)
91- item.delegateCreationEnd = Math.min(categoryView.height + item.delegateCreationBegin, baseItem.height)
92+ item.delegateCreationBegin = item.originY + Math.max(-baseItem.y, 0)
93+ item.delegateCreationEnd = item.originY + Math.min(categoryView.height + item.delegateCreationBegin, baseItem.height)
94 }
95 }
96 }

Subscribers

People subscribed via source and target branches