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
1=== modified file 'qml/Dash/CardGrid.qml'
2--- qml/Dash/CardGrid.qml 2016-01-28 10:49:58 +0000
3+++ qml/Dash/CardGrid.qml 2016-01-28 10:49:59 +0000
4@@ -20,6 +20,7 @@
5 DashRenderer {
6 id: root
7
8+ readonly property real defaultMinimumHorizontalSpacing: units.gu(1)
9 readonly property int collapsedRows: {
10 if (!cardTool || !cardTool.template || typeof cardTool.template["collapsed-rows"] != "number") return 2;
11 return cardTool.template["collapsed-rows"];
12@@ -46,7 +47,7 @@
13 ResponsiveGridView {
14 id: grid
15 anchors.fill: parent
16- minimumHorizontalSpacing: units.gu(1)
17+ minimumHorizontalSpacing: root.defaultMinimumHorizontalSpacing
18 delegateWidth: cardTool.cardWidth
19 delegateHeight: cardTool.cardHeight
20 verticalSpacing: units.gu(1)
21
22=== modified file 'qml/Dash/GenericScopeView.qml'
23--- qml/Dash/GenericScopeView.qml 2016-01-28 10:49:58 +0000
24+++ qml/Dash/GenericScopeView.qml 2016-01-28 10:49:59 +0000
25@@ -360,17 +360,9 @@
26 baseItem.expand(shouldExpand, false /*animate*/);
27 }
28 updateRanges();
29+ clickScopeSizingHacks();
30 if (scope && scope.id === "clickscope") {
31 if (categoryId === "predefined" || categoryId === "local") {
32- // Yeah, hackish :/
33- if (scopeView.width > units.gu(45)) {
34- if (scopeView.width >= units.gu(70)) {
35- cardTool.cardWidth = units.gu(11);
36- item.minimumHorizontalSpacing = units.gu(5)
37- } else {
38- cardTool.cardWidth = units.gu(10);
39- }
40- }
41 cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
42 item.artShapeStyle = "icon";
43 } else {
44@@ -388,6 +380,23 @@
45 }
46 }
47
48+ function clickScopeSizingHacks() {
49+ if (scope && scope.id === "clickscope" &&
50+ (categoryId === "predefined" || categoryId === "local")) {
51+ // Yeah, hackish :/
52+ if (scopeView.width > units.gu(45)) {
53+ if (scopeView.width >= units.gu(70)) {
54+ cardTool.cardWidth = units.gu(11);
55+ item.minimumHorizontalSpacing = units.gu(5);
56+ return;
57+ } else {
58+ cardTool.cardWidth = units.gu(10);
59+ }
60+ }
61+ item.minimumHorizontalSpacing = item.defaultMinimumHorizontalSpacing;
62+ }
63+ }
64+
65 Connections {
66 target: rendererLoader.item
67 onClicked: { // (int index, var result, var item, var itemModel)
68@@ -417,6 +426,7 @@
69 target: scopeView
70 onIsCurrentChanged: rendererLoader.updateRanges();
71 onVisibleToParentChanged: rendererLoader.updateRanges();
72+ onWidthChanged: rendererLoader.clickScopeSizingHacks();
73 }
74 Connections {
75 target: holdingList
76
77=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
78--- tests/qmltests/Dash/tst_GenericScopeView.qml 2016-01-28 10:49:58 +0000
79+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2016-01-28 10:49:59 +0000
80@@ -666,6 +666,26 @@
81 var shape = findChildsByType(artShapeLoader, "UCUbuntuShape");
82 compare(shape.borderSource, undefined);
83 }
84+
85+ function test_clickScopeSizing() {
86+ genericScopeView.scope = scopes.getScopeFromAll("clickscope");
87+ waitForRendering(genericScopeView);
88+
89+ var categoryListView = findChild(genericScopeView, "categoryListView");
90+ waitForRendering(categoryListView);
91+
92+ var categorypredefined = findChild(categoryListView, "dashCategorypredefined");
93+ waitForRendering(categorypredefined);
94+
95+ var cardTool = findChild(categorypredefined, "cardTool");
96+
97+ compare(cardTool.cardWidth, units.gu(11));
98+ shell.width = units.gu(46);
99+ waitForRendering(genericScopeView);
100+ compare(cardTool.cardWidth, units.gu(10));
101+
102+ shell.width = units.gu(120)
103+ }
104 }
105 }
106 }

Subscribers

People subscribed via source and target branches