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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 1600
Merged at revision: 1625
Proposed branch: lp:~aacid/unity8/attributeAspectRatio
Merge into: lp:unity8
Diff against target: 58 lines (+8/-0)
4 files modified
plugins/Dash/CardAttributes.qml (+2/-0)
plugins/Dash/CardCreator.js (+3/-0)
qml/Panel/IndicatorItem.qml (+2/-0)
tests/plugins/Dash/cardcreator/6.res (+1/-0)
To merge this branch: bzr merge lp:~aacid/unity8/attributeAspectRatio
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Abstain
Andrea Cimitan (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz visual Approve
Review via email: mp+249472@code.launchpad.net

Commit message

Preserve the aspect ratio for the card attribute images

Description of the change

 * 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

 * Did you make sure that your branch does not contain spurious tags?
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.
1598. By Albert Astals Cid

Two other places where we want to maintin the AR

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

Not great. See

https://owncloud.sawicz.net/public.php?service=files&t=0afe9e8a599ef8fef2f2a105e9db357d&path=%2F&files=out.png&download

Battery indicator squashed, and on krillin the title disappeard completely ¿?.

review: Needs Fixing
1599. By Albert Astals Cid

Protect against SVG

Revision history for this message
Michał Sawicz (saviq) wrote :

Can you add comments as to why we need to do it this way?

And surely this should not be required to get an icon that preserves the aspect ratio? So a SDK bug is, IMO, in order.

review: Approve (visual)
1600. By Albert Astals Cid

Add explanations for the width: code

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) :
Revision history for this message
Albert Astals Cid (aacid) :
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
 * Did CI run pass? If not, please explain why.
Unrelated
 * Did you make sure that the branch does not contain spurious tags?
Yes

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

This fails testCardCreator

review: Needs Fixing
1601. By Albert Astals Cid

Merge

1602. By Albert Astals Cid

Fix cardcreator test

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

Wops, you're right, fixed

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Wops, you're right, fixed

thanks.

review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/CardAttributes.qml'
2--- plugins/Dash/CardAttributes.qml 2014-11-17 10:09:40 +0000
3+++ plugins/Dash/CardAttributes.qml 2015-02-24 09:06:19 +0000
4@@ -49,6 +49,8 @@
5 Icon {
6 id: icon
7 height: units.gu(2)
8+ // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
9+ width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
10 source: "icon" in modelData && modelData["icon"] || ""
11 color: grid.color
12 }
13
14=== modified file 'plugins/Dash/CardCreator.js'
15--- plugins/Dash/CardCreator.js 2015-01-22 12:05:43 +0000
16+++ plugins/Dash/CardCreator.js 2015-02-24 09:06:19 +0000
17@@ -224,6 +224,8 @@
18
19 // %1 is used as extra anchors of emblemIcon
20 // %2 is used as color of emblemIcon
21+// FIXME The width code is a
22+// Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
23 var kEmblemIconCode = 'Icon { \n\
24 id: emblemIcon; \n\
25 objectName: "emblemIcon"; \n\
26@@ -235,6 +237,7 @@
27 source: cardData && cardData["emblem"] || ""; \n\
28 color: %2; \n\
29 height: source != "" ? titleLabel.font.pixelSize : 0; \n\
30+ width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth; \n\
31 }\n';
32
33 // %1 is used as anchors of touchdown effect
34
35=== modified file 'qml/Panel/IndicatorItem.qml'
36--- qml/Panel/IndicatorItem.qml 2014-11-28 17:07:44 +0000
37+++ qml/Panel/IndicatorItem.qml 2015-02-24 09:06:19 +0000
38@@ -95,6 +95,8 @@
39 id: itemImage
40 objectName: "icon"+index
41 height: iconHeight
42+ // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
43+ width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth;
44 source: modelData
45 color: root.color
46 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing } }
47
48=== modified file 'tests/plugins/Dash/cardcreator/6.res'
49--- tests/plugins/Dash/cardcreator/6.res 2014-11-17 10:09:40 +0000
50+++ tests/plugins/Dash/cardcreator/6.res 2015-02-24 09:06:19 +0000
51@@ -106,6 +106,7 @@
52 source: cardData && cardData["emblem"] || "";
53 color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
54 height: source != "" ? titleLabel.font.pixelSize : 0;
55+ width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth;
56 }
57
58 ]

Subscribers

People subscribed via source and target branches