Merge lp:~unity-team/ubuntu-ui-toolkit/dynamic-grid-unit into lp:ubuntu-ui-toolkit/staging
- dynamic-grid-unit
- Merge into staging
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Zoltan Balogh | ||||
Approved revision: | 1321 | ||||
Merged at revision: | 1966 | ||||
Proposed branch: | lp:~unity-team/ubuntu-ui-toolkit/dynamic-grid-unit | ||||
Merge into: | lp:ubuntu-ui-toolkit/staging | ||||
Diff against target: |
146 lines (+31/-15) 7 files modified
src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml (+1/-1) src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+7/-7) src/Ubuntu/Components/Themes/Ambiance/1.3/SheetForegroundStyle.qml (+1/-1) src/Ubuntu/Components/plugin/label_p.h (+0/-1) src/Ubuntu/Components/plugin/uclabel.cpp (+3/-5) src/Ubuntu/Components/plugin/uclabel.h (+1/-0) tests/unit/tst_components/tst_label13.qml (+18/-0) |
||||
To merge this branch: | bzr merge lp:~unity-team/ubuntu-ui-toolkit/dynamic-grid-unit | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Cris Dywan | Approve | ||
Review via email: mp+293135@code.launchpad.net |
Commit message
Additional DGU fixes
Description of the change
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1317
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1317
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1317
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1317
https:/
Executed test runs:
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1318
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1318
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1318
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1318
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1318
https:/
Executed test runs:
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Cris Dywan (kalikiana) wrote : | # |
+++ src/Ubuntu/
+++ src/Ubuntu/
Unsure if those 1.2 bits should be done. Arguably they are not critical fixes and it's better to avoid changing that version.
The Qt.binding pattern seems sensible. Probably not unit-testable as they all affect visuals which we don't test for exact values anyway.
However uclabel.cpp we need to test. We had a bug before with defaults, not the size but the color. See tests/unit_
Albert Astals Cid (aacid) wrote : | # |
> Unsure if those 1.2 bits should be done. Arguably they are not critical
> fixes and it's better to avoid changing that version.
1.2 changes reverted
Albert Astals Cid (aacid) wrote : | # |
> However uclabel.cpp we need to test.
Added a test that proves the change is needed (fails with the old code). None of the existing tests regresses. Is that enough?
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1319
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1319
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1319
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1319
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1319
https:/
Executed test runs:
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Cris Dywan (kalikiana) wrote : | # |
> > However uclabel.cpp we need to test.
>
> Added a test that proves the change is needed (fails with the old code). None
> of the existing tests regresses. Is that enough?
Perfect!
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1321
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml' | |||
2 | --- src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml 2015-09-21 14:44:13 +0000 | |||
3 | +++ src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml 2016-04-29 10:30:35 +0000 | |||
4 | @@ -127,7 +127,7 @@ | |||
5 | 127 | } | 127 | } |
6 | 128 | 128 | ||
7 | 129 | Component.onCompleted: { | 129 | Component.onCompleted: { |
9 | 130 | height = listView.itemHeight = childrenRect.height; | 130 | height = listView.itemHeight = Qt.binding(function() { return childrenRect.height; }); |
10 | 131 | } | 131 | } |
11 | 132 | 132 | ||
12 | 133 | //Since we don't want to add states to our divider, we use the exposed alias provided in Empty to access it and alter it's opacity from here. | 133 | //Since we don't want to add states to our divider, we use the exposed alias provided in Empty to access it and alter it's opacity from here. |
13 | 134 | 134 | ||
14 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml' | |||
15 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-04-27 13:58:24 +0000 | |||
16 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-04-29 10:30:35 +0000 | |||
17 | @@ -63,19 +63,19 @@ | |||
18 | 63 | if (landscape) { | 63 | if (landscape) { |
19 | 64 | if (hasSubtitle) { | 64 | if (hasSubtitle) { |
20 | 65 | // with subtitle, and with or without extension | 65 | // with subtitle, and with or without extension |
23 | 66 | titleAreaHeight = units.gu(4); | 66 | titleAreaHeight = Qt.binding(function() { return units.gu(4) }); |
24 | 67 | titleBottomSpacing = units.gu(2); | 67 | titleBottomSpacing = Qt.binding(function() { return units.gu(2) }); |
25 | 68 | } else if (hasExtension) { | 68 | } else if (hasExtension) { |
28 | 69 | titleAreaHeight = units.gu(4); | 69 | titleAreaHeight = Qt.binding(function() { return units.gu(4) }); |
29 | 70 | titleBottomSpacing = units.gu(1); | 70 | titleBottomSpacing = Qt.binding(function() { return units.gu(1) }); |
30 | 71 | } else { | 71 | } else { |
32 | 72 | titleAreaHeight = units.gu(5) | 72 | titleAreaHeight = Qt.binding(function() { return units.gu(5) }); |
33 | 73 | titleBottomSpacing = 0; | 73 | titleBottomSpacing = 0; |
34 | 74 | } | 74 | } |
35 | 75 | } else { // portrait | 75 | } else { // portrait |
37 | 76 | titleAreaHeight = units.gu(6); | 76 | titleAreaHeight = Qt.binding(function() { return units.gu(6) }); |
38 | 77 | if (hasSubtitle) { | 77 | if (hasSubtitle) { |
40 | 78 | titleBottomSpacing = units.gu(1); | 78 | titleBottomSpacing = Qt.binding(function() { return units.gu(1) }); |
41 | 79 | } else { | 79 | } else { |
42 | 80 | titleBottomSpacing = 0; | 80 | titleBottomSpacing = 0; |
43 | 81 | } | 81 | } |
44 | 82 | 82 | ||
45 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SheetForegroundStyle.qml' | |||
46 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/SheetForegroundStyle.qml 2015-04-25 07:36:13 +0000 | |||
47 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/SheetForegroundStyle.qml 2016-04-29 10:30:35 +0000 | |||
48 | @@ -81,7 +81,7 @@ | |||
49 | 81 | button.anchors.left = container.left; | 81 | button.anchors.left = container.left; |
50 | 82 | button.anchors.right = container.right; | 82 | button.anchors.right = container.right; |
51 | 83 | button.anchors.verticalCenter = container.verticalCenter; | 83 | button.anchors.verticalCenter = container.verticalCenter; |
53 | 84 | button.anchors.margins = units.gu(1); | 84 | button.anchors.margins = Qt.binding(function() { return units.gu(1) }); |
54 | 85 | } | 85 | } |
55 | 86 | 86 | ||
56 | 87 | Connections { | 87 | Connections { |
57 | 88 | 88 | ||
58 | === modified file 'src/Ubuntu/Components/plugin/label_p.h' | |||
59 | --- src/Ubuntu/Components/plugin/label_p.h 2016-03-11 19:28:41 +0000 | |||
60 | +++ src/Ubuntu/Components/plugin/label_p.h 2016-04-29 10:30:35 +0000 | |||
61 | @@ -47,7 +47,6 @@ | |||
62 | 47 | }; | 47 | }; |
63 | 48 | 48 | ||
64 | 49 | UCLabel *q_ptr; | 49 | UCLabel *q_ptr; |
65 | 50 | QFont defaultFont; | ||
66 | 51 | UCLabel::ColorProviderFunc defaultColor; | 50 | UCLabel::ColorProviderFunc defaultColor; |
67 | 52 | UCLabel::TextSize textSize; | 51 | UCLabel::TextSize textSize; |
68 | 53 | quint8 flags; | 52 | quint8 flags; |
69 | 54 | 53 | ||
70 | === modified file 'src/Ubuntu/Components/plugin/uclabel.cpp' | |||
71 | --- src/Ubuntu/Components/plugin/uclabel.cpp 2016-04-20 15:00:27 +0000 | |||
72 | +++ src/Ubuntu/Components/plugin/uclabel.cpp 2016-04-29 10:30:35 +0000 | |||
73 | @@ -130,16 +130,14 @@ | |||
74 | 130 | q->postThemeChanged(); | 130 | q->postThemeChanged(); |
75 | 131 | 131 | ||
76 | 132 | updatePixelSize(); | 132 | updatePixelSize(); |
78 | 133 | defaultFont = q->font(); | 133 | QFont defaultFont = q->font(); |
79 | 134 | defaultFont.setFamily("Ubuntu"); | 134 | defaultFont.setFamily("Ubuntu"); |
80 | 135 | defaultFont.setWeight(QFont::Light); | 135 | defaultFont.setWeight(QFont::Light); |
81 | 136 | q->setFont(defaultFont); | 136 | q->setFont(defaultFont); |
82 | 137 | updateRenderType(); | 137 | updateRenderType(); |
83 | 138 | 138 | ||
84 | 139 | QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(updateRenderType())); | 139 | QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(updateRenderType())); |
88 | 140 | QObject::connect(UCUnits::instance(), &UCUnits::gridUnitChanged, q, [this](){ | 140 | QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(updatePixelSize())); |
86 | 141 | updatePixelSize(); | ||
87 | 142 | }, Qt::DirectConnection); | ||
89 | 143 | 141 | ||
90 | 144 | QObject::connect(q, &UCLabel::enabledChanged, q, &UCLabel::postThemeChanged, Qt::DirectConnection); | 142 | QObject::connect(q, &UCLabel::enabledChanged, q, &UCLabel::postThemeChanged, Qt::DirectConnection); |
91 | 145 | 143 | ||
92 | @@ -202,7 +200,7 @@ | |||
93 | 202 | Q_D(UCLabel); | 200 | Q_D(UCLabel); |
94 | 203 | // we must restrict ourself to the pixelSize change as any font property change will | 201 | // we must restrict ourself to the pixelSize change as any font property change will |
95 | 204 | // lead to the setter call. | 202 | // lead to the setter call. |
97 | 205 | if (d->defaultFont.pixelSize() != font.pixelSize()) { | 203 | if (this->font().pixelSize() != font.pixelSize()) { |
98 | 206 | d->flags |= UCLabelPrivate::PixelSizeSet; | 204 | d->flags |= UCLabelPrivate::PixelSizeSet; |
99 | 207 | } | 205 | } |
100 | 208 | QQuickText::setFont(font); | 206 | QQuickText::setFont(font); |
101 | 209 | 207 | ||
102 | === modified file 'src/Ubuntu/Components/plugin/uclabel.h' | |||
103 | --- src/Ubuntu/Components/plugin/uclabel.h 2016-04-20 15:00:27 +0000 | |||
104 | +++ src/Ubuntu/Components/plugin/uclabel.h 2016-04-29 10:30:35 +0000 | |||
105 | @@ -91,6 +91,7 @@ | |||
106 | 91 | Q_DECLARE_PRIVATE_D(d_ptr.data(), UCLabel) | 91 | Q_DECLARE_PRIVATE_D(d_ptr.data(), UCLabel) |
107 | 92 | Q_DISABLE_COPY(UCLabel) | 92 | Q_DISABLE_COPY(UCLabel) |
108 | 93 | Q_PRIVATE_SLOT(d_func(), void updateRenderType()) | 93 | Q_PRIVATE_SLOT(d_func(), void updateRenderType()) |
109 | 94 | Q_PRIVATE_SLOT(d_func(), void updatePixelSize()) | ||
110 | 94 | }; | 95 | }; |
111 | 95 | 96 | ||
112 | 96 | QML_DECLARE_TYPE(UCLabel) | 97 | QML_DECLARE_TYPE(UCLabel) |
113 | 97 | 98 | ||
114 | === modified file 'tests/unit/tst_components/tst_label13.qml' | |||
115 | --- tests/unit/tst_components/tst_label13.qml 2016-03-14 18:56:42 +0000 | |||
116 | +++ tests/unit/tst_components/tst_label13.qml 2016-04-29 10:30:35 +0000 | |||
117 | @@ -158,6 +158,20 @@ | |||
118 | 158 | verifyManualRenderType(textSetRenderType, Text.NativeRendering); | 158 | verifyManualRenderType(textSetRenderType, Text.NativeRendering); |
119 | 159 | } | 159 | } |
120 | 160 | 160 | ||
121 | 161 | function test_colorGUPixelSize() { | ||
122 | 162 | units.gridUnit = 8; | ||
123 | 163 | textTestColorGUPixelSize.font.bold = true; | ||
124 | 164 | var pixelSizeAt8GU = textTestColorGUPixelSize.font.pixelSize; | ||
125 | 165 | |||
126 | 166 | units.gridUnit = 16; | ||
127 | 167 | textTestColorGUPixelSize.font.bold = false; | ||
128 | 168 | verify(textTestColorGUPixelSize.font.pixelSize > pixelSizeAt8GU); | ||
129 | 169 | |||
130 | 170 | units.gridUnit = 8; | ||
131 | 171 | textTestColorGUPixelSize.font.bold = true; | ||
132 | 172 | compare(textTestColorGUPixelSize.font.pixelSize, pixelSizeAt8GU); | ||
133 | 173 | } | ||
134 | 174 | |||
135 | 161 | Label { | 175 | Label { |
136 | 162 | id: textCustom | 176 | id: textCustom |
137 | 163 | } | 177 | } |
138 | @@ -192,4 +206,8 @@ | |||
139 | 192 | Label { | 206 | Label { |
140 | 193 | id: textSetRenderType | 207 | id: textSetRenderType |
141 | 194 | } | 208 | } |
142 | 209 | |||
143 | 210 | Label { | ||
144 | 211 | id: textTestColorGUPixelSize | ||
145 | 212 | } | ||
146 | 195 | } | 213 | } |
PASSED: Continuous integration, rev:1317 /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-i386- gles-stable/ 520/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/3009/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-i386- gles-stable/ 520/rebuild
https:/