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
=== modified file 'qml/Components/FilterGrid.qml'
--- qml/Components/FilterGrid.qml 2014-01-29 13:35:40 +0000
+++ qml/Components/FilterGrid.qml 2014-04-08 13:51:08 +0000
@@ -59,6 +59,7 @@
59 property alias cellHeight: iconTileGrid.cellHeight59 property alias cellHeight: iconTileGrid.cellHeight
60 property alias delegateCreationBegin: iconTileGrid.delegateCreationBegin60 property alias delegateCreationBegin: iconTileGrid.delegateCreationBegin
61 property alias delegateCreationEnd: iconTileGrid.delegateCreationEnd61 property alias delegateCreationEnd: iconTileGrid.delegateCreationEnd
62 readonly property alias originY: iconTileGrid.originY
62 readonly property alias flicking: iconTileGrid.flicking63 readonly property alias flicking: iconTileGrid.flicking
63 readonly property alias moving: iconTileGrid.moving64 readonly property alias moving: iconTileGrid.moving
64 readonly property alias pressDelay: iconTileGrid.pressDelay65 readonly property alias pressDelay: iconTileGrid.pressDelay
6566
=== modified file 'qml/Components/ResponsiveGridView.qml'
--- qml/Components/ResponsiveGridView.qml 2014-02-21 11:08:42 +0000
+++ qml/Components/ResponsiveGridView.qml 2014-04-08 13:51:08 +0000
@@ -40,6 +40,7 @@
40 readonly property alias flicking: gridView.flicking40 readonly property alias flicking: gridView.flicking
41 readonly property alias moving: gridView.moving41 readonly property alias moving: gridView.moving
42 readonly property alias pressDelay: gridView.pressDelay42 readonly property alias pressDelay: gridView.pressDelay
43 readonly property alias originY: gridView.originY
43 property alias delegateCreationBegin: gridView.delegateCreationBegin44 property alias delegateCreationBegin: gridView.delegateCreationBegin
44 property alias delegateCreationEnd: gridView.delegateCreationEnd45 property alias delegateCreationEnd: gridView.delegateCreationEnd
45 property alias highlightIndex: gridView.highlightIndex46 property alias highlightIndex: gridView.highlightIndex
4647
=== modified file 'qml/Dash/CardFilterGrid.qml'
--- qml/Dash/CardFilterGrid.qml 2014-03-26 15:09:25 +0000
+++ qml/Dash/CardFilterGrid.qml 2014-04-08 13:51:08 +0000
@@ -24,6 +24,7 @@
24 collapsedHeight: filterGrid.collapsedHeight24 collapsedHeight: filterGrid.collapsedHeight
25 margins: filterGrid.margins25 margins: filterGrid.margins
26 uncollapsedHeight: filterGrid.uncollapsedHeight26 uncollapsedHeight: filterGrid.uncollapsedHeight
27 originY: filterGrid.originY
27 verticalSpacing: units.gu(1)28 verticalSpacing: units.gu(1)
28 currentItem: filterGrid.currentItem29 currentItem: filterGrid.currentItem
29 height: filterGrid.height30 height: filterGrid.height
3031
=== modified file 'qml/Dash/DashRenderer.qml'
--- qml/Dash/DashRenderer.qml 2014-03-26 15:09:25 +0000
+++ qml/Dash/DashRenderer.qml 2014-04-08 13:51:08 +0000
@@ -33,6 +33,8 @@
3333
34 property var delegateCreationEnd: undefined34 property var delegateCreationEnd: undefined
3535
36 property real originY: 0
37
36 property real verticalSpacing: 038 property real verticalSpacing: 0
3739
38 // The current item of the renderer40 // The current item of the renderer
3941
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2014-04-01 22:56:21 +0000
+++ qml/Dash/GenericScopeView.qml 2014-04-08 13:51:08 +0000
@@ -237,26 +237,29 @@
237 }237 }
238238
239 function updateDelegateCreationRange() {239 function updateDelegateCreationRange() {
240 // Do not update the range if we are overshooting up or down, since we'll come back240 if (moving) {
241 // to the stable position and delete/create items without any reason241 // Do not update the range if we are overshooting up or down, since we'll come back
242 if (categoryView.contentY < categoryView.originY) {242 // to the stable position and delete/create items without any reason
243 return;243 if (categoryView.contentY < categoryView.originY) {
244 } else if (categoryView.contentY + categoryView.height > categoryView.contentHeight) {244 return;
245 return;245 } else if (categoryView.originY + categoryView.contentHeight > categoryView.height &&
246 categoryView.contentY + categoryView.height > categoryView.contentHeight) {
247 return;
248 }
246 }249 }
247250
248 if (item && item.hasOwnProperty("delegateCreationBegin")) {251 if (item && item.hasOwnProperty("delegateCreationBegin")) {
249 if (baseItem.y + baseItem.height <= 0) {252 if (baseItem.y + baseItem.height <= 0) {
250 // Not visible (item at top of the list)253 // Not visible (item at top of the list viewport)
251 item.delegateCreationBegin = baseItem.height254 item.delegateCreationBegin = item.originY + baseItem.height
252 item.delegateCreationEnd = baseItem.height255 item.delegateCreationEnd = item.originY + baseItem.height
253 } else if (baseItem.y >= categoryView.height) {256 } else if (baseItem.y >= categoryView.height) {
254 // Not visible (item at bottom of the list)257 // Not visible (item at bottom of the list viewport)
255 item.delegateCreationBegin = 0258 item.delegateCreationBegin = item.originY
256 item.delegateCreationEnd = 0259 item.delegateCreationEnd = item.originY
257 } else {260 } else {
258 item.delegateCreationBegin = Math.max(-baseItem.y, 0)261 item.delegateCreationBegin = item.originY + Math.max(-baseItem.y, 0)
259 item.delegateCreationEnd = Math.min(categoryView.height + item.delegateCreationBegin, baseItem.height)262 item.delegateCreationEnd = item.originY + Math.min(categoryView.height + item.delegateCreationBegin, baseItem.height)
260 }263 }
261 }264 }
262 }265 }

Subscribers

People subscribed via source and target branches