Merge lp:~cimi/unity8/fix-1536745 into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Michał Sawicz
Approved revision: 2140
Merged at revision: 2165
Proposed branch: lp:~cimi/unity8/fix-1536745
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/avila_apps_scope
Diff against target: 106 lines (+41/-10)
3 files modified
qml/Dash/CardGrid.qml (+2/-1)
qml/Dash/GenericScopeView.qml (+19/-9)
tests/qmltests/Dash/tst_GenericScopeView.qml (+20/-0)
To merge this branch: bzr merge lp:~cimi/unity8/fix-1536745
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) code looks good Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity8 CI Bot continuous-integration Approve
Review via email: mp+283674@code.launchpad.net

This proposal supersedes a proposal from 2016-01-22.

Commit message

Dynamically change click scope card size according to size

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
n
 * Did you perform an exploratory manual test run of your code change and any related functionality?
y
 * Did you make sure that your branch does not contain spurious tags?
y
 * 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 : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2138
http://jenkins.qa.ubuntu.com/job/unity8-ci/7132/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6144
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/547/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1837
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/540
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1732
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1732
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/539
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/538
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4740
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6155
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6155/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26944
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/282/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/545
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/545/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26948

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2138
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/174/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/174/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2139
http://jenkins.qa.ubuntu.com/job/unity8-ci/7136/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6157
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/551/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1841
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/544
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1736
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1736
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/543
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/542
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4751
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6168
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6168/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26965
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/286/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/549
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/549/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26964

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2139
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/178/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/178/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

The return; in if (scopeView.width >= units.gu(70)) { makes artShapeSize not be set, no?

review: Needs Fixing
lp:~cimi/unity8/fix-1536745 updated
2140. By Andrea Cimitan

Moved some code in more logic place

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2140
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/218/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/218/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2140
http://jenkins.qa.ubuntu.com/job/unity8-ci/7168/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6236
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/583/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1873
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/576
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1768
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1768
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/575
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/574
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4804
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6247
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6247/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27115
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/302/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/581
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/581/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27117

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

> The return; in if (scopeView.width >= units.gu(70)) { makes artShapeSize not
> be set, no?

it should not require being changed anyway, but I moved it up in the onLoaded of the loader because it's better there since it doesnt need to be recalculated twice :)

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

> it should not require being changed anyway
No, it's not required to change, but as it was, it was never set even once.

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

 * Did you perform an exploratory manual test run of the code change and any related functionality?
No, Saviq will test with the whole silo

 * Did CI run pass?
Mostly yes, some known hickups not related

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve (code looks good)
Revision history for this message
Michał Sawicz (saviq) wrote :

Approving per cimi's silo testing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Dash/CardGrid.qml'
--- qml/Dash/CardGrid.qml 2016-01-28 10:49:58 +0000
+++ qml/Dash/CardGrid.qml 2016-01-28 10:49:59 +0000
@@ -20,6 +20,7 @@
20DashRenderer {20DashRenderer {
21 id: root21 id: root
2222
23 readonly property real defaultMinimumHorizontalSpacing: units.gu(1)
23 readonly property int collapsedRows: {24 readonly property int collapsedRows: {
24 if (!cardTool || !cardTool.template || typeof cardTool.template["collapsed-rows"] != "number") return 2;25 if (!cardTool || !cardTool.template || typeof cardTool.template["collapsed-rows"] != "number") return 2;
25 return cardTool.template["collapsed-rows"];26 return cardTool.template["collapsed-rows"];
@@ -46,7 +47,7 @@
46 ResponsiveGridView {47 ResponsiveGridView {
47 id: grid48 id: grid
48 anchors.fill: parent49 anchors.fill: parent
49 minimumHorizontalSpacing: units.gu(1)50 minimumHorizontalSpacing: root.defaultMinimumHorizontalSpacing
50 delegateWidth: cardTool.cardWidth51 delegateWidth: cardTool.cardWidth
51 delegateHeight: cardTool.cardHeight52 delegateHeight: cardTool.cardHeight
52 verticalSpacing: units.gu(1)53 verticalSpacing: units.gu(1)
5354
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2016-01-28 10:49:58 +0000
+++ qml/Dash/GenericScopeView.qml 2016-01-28 10:49:59 +0000
@@ -360,17 +360,9 @@
360 baseItem.expand(shouldExpand, false /*animate*/);360 baseItem.expand(shouldExpand, false /*animate*/);
361 }361 }
362 updateRanges();362 updateRanges();
363 clickScopeSizingHacks();
363 if (scope && scope.id === "clickscope") {364 if (scope && scope.id === "clickscope") {
364 if (categoryId === "predefined" || categoryId === "local") {365 if (categoryId === "predefined" || categoryId === "local") {
365 // Yeah, hackish :/
366 if (scopeView.width > units.gu(45)) {
367 if (scopeView.width >= units.gu(70)) {
368 cardTool.cardWidth = units.gu(11);
369 item.minimumHorizontalSpacing = units.gu(5)
370 } else {
371 cardTool.cardWidth = units.gu(10);
372 }
373 }
374 cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));366 cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
375 item.artShapeStyle = "icon";367 item.artShapeStyle = "icon";
376 } else {368 } else {
@@ -388,6 +380,23 @@
388 }380 }
389 }381 }
390382
383 function clickScopeSizingHacks() {
384 if (scope && scope.id === "clickscope" &&
385 (categoryId === "predefined" || categoryId === "local")) {
386 // Yeah, hackish :/
387 if (scopeView.width > units.gu(45)) {
388 if (scopeView.width >= units.gu(70)) {
389 cardTool.cardWidth = units.gu(11);
390 item.minimumHorizontalSpacing = units.gu(5);
391 return;
392 } else {
393 cardTool.cardWidth = units.gu(10);
394 }
395 }
396 item.minimumHorizontalSpacing = item.defaultMinimumHorizontalSpacing;
397 }
398 }
399
391 Connections {400 Connections {
392 target: rendererLoader.item401 target: rendererLoader.item
393 onClicked: { // (int index, var result, var item, var itemModel)402 onClicked: { // (int index, var result, var item, var itemModel)
@@ -417,6 +426,7 @@
417 target: scopeView426 target: scopeView
418 onIsCurrentChanged: rendererLoader.updateRanges();427 onIsCurrentChanged: rendererLoader.updateRanges();
419 onVisibleToParentChanged: rendererLoader.updateRanges();428 onVisibleToParentChanged: rendererLoader.updateRanges();
429 onWidthChanged: rendererLoader.clickScopeSizingHacks();
420 }430 }
421 Connections {431 Connections {
422 target: holdingList432 target: holdingList
423433
=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
--- tests/qmltests/Dash/tst_GenericScopeView.qml 2016-01-28 10:49:58 +0000
+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2016-01-28 10:49:59 +0000
@@ -666,6 +666,26 @@
666 var shape = findChildsByType(artShapeLoader, "UCUbuntuShape");666 var shape = findChildsByType(artShapeLoader, "UCUbuntuShape");
667 compare(shape.borderSource, undefined);667 compare(shape.borderSource, undefined);
668 }668 }
669
670 function test_clickScopeSizing() {
671 genericScopeView.scope = scopes.getScopeFromAll("clickscope");
672 waitForRendering(genericScopeView);
673
674 var categoryListView = findChild(genericScopeView, "categoryListView");
675 waitForRendering(categoryListView);
676
677 var categorypredefined = findChild(categoryListView, "dashCategorypredefined");
678 waitForRendering(categorypredefined);
679
680 var cardTool = findChild(categorypredefined, "cardTool");
681
682 compare(cardTool.cardWidth, units.gu(11));
683 shell.width = units.gu(46);
684 waitForRendering(genericScopeView);
685 compare(cardTool.cardWidth, units.gu(10));
686
687 shell.width = units.gu(120)
688 }
669 }689 }
670 }690 }
671}691}

Subscribers

People subscribed via source and target branches