Merge lp:~unity-team/ubuntu-ui-toolkit/dynamic-grid-unit into lp:ubuntu-ui-toolkit

Proposed by Michał Sawicz
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1321
Merged at revision: 1310
Proposed branch: lp:~unity-team/ubuntu-ui-toolkit/dynamic-grid-unit
Merge into: lp:ubuntu-ui-toolkit
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
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot continuous-integration Needs Fixing
Tim Peeters Needs Information
Cris Dywan Needs Fixing
Review via email: mp+292417@code.launchpad.net

This proposal supersedes a proposal from 2016-02-03.

Commit message

Enable dynamic changing of grid units instigated by the shell

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
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
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)
1305. By Michał Sawicz

Don't try to connect to null native interface

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

> qDebug() << "GRID UNIT changed to " << m_gridUnit;

No unconditional debug spam, please.

What about unit test?

Note: This MR needs to be targeted at staging, not trunk!

review: Needs Fixing
Revision history for this message
Tim Peeters (tpeeters) wrote :

+ // HACK - if multimonitor situation, ignore any scale changes reported by the LVDS screen (unity8-specific policy)

So is this a bug that needs to be fixed? If yes, please link to the bug here.

review: Needs Information
1306. By Michał Sawicz

Drop debug, bump copyright

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

Improve ucunits.cpp comment and reference the LP bug

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1308. By Albert Astals Cid

Add a test for scale

1309. By Albert Astals Cid

2016

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)
1310. By Gerry Boland

UCLabel: should compare pixel size changes with previous font pixel size, not the default

Revision history for this message
Gerry Boland (gerboland) wrote :

Marking WIP as we're using this branch in our silo

1311. By Gerry Boland

Combine slot calls on GU change

1312. By Gerry Boland

PageHeaderStyle: bind units.gu to the contentHeight, do not set by value

1313. By Gerry Boland

SheetForegroundStyle: bind units.gu to the bottom margin, do not set by value

1314. By Michał Sawicz

Split the connect

1315. By Michał Sawicz

Declare as slot

1316. By Gerry Boland

Merge trunk

1317. By Gerry Boland

OptionSelector - delegate heights set as binding not value

1318. By Michał Sawicz

Merge staging

1319. By Albert Astals Cid

Let 1.2 be broken as requested by reviewers

Maybe this way we get a quicker move to 1.3 :D

1320. By Albert Astals Cid

Add test proving why we need the uclabel patch

1321. By Albert Astals Cid

better name

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

This got merged into staging as two revisions, this MP just targets trunk with combined diff (to not cherry-pick and confuse staging).

https://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/revision/1953
https://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/revision/1966

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml'
--- src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml 2015-09-21 14:44:13 +0000
+++ src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml 2016-04-29 10:30:35 +0000
@@ -127,7 +127,7 @@
127 }127 }
128128
129 Component.onCompleted: {129 Component.onCompleted: {
130 height = listView.itemHeight = childrenRect.height;130 height = listView.itemHeight = Qt.binding(function() { return childrenRect.height; });
131 }131 }
132132
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.
134134
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-04-27 13:58:24 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-04-29 10:30:35 +0000
@@ -63,19 +63,19 @@
63 if (landscape) {63 if (landscape) {
64 if (hasSubtitle) {64 if (hasSubtitle) {
65 // with subtitle, and with or without extension65 // with subtitle, and with or without extension
66 titleAreaHeight = units.gu(4);66 titleAreaHeight = Qt.binding(function() { return units.gu(4) });
67 titleBottomSpacing = units.gu(2);67 titleBottomSpacing = Qt.binding(function() { return units.gu(2) });
68 } else if (hasExtension) {68 } else if (hasExtension) {
69 titleAreaHeight = units.gu(4);69 titleAreaHeight = Qt.binding(function() { return units.gu(4) });
70 titleBottomSpacing = units.gu(1);70 titleBottomSpacing = Qt.binding(function() { return units.gu(1) });
71 } else {71 } else {
72 titleAreaHeight = units.gu(5)72 titleAreaHeight = Qt.binding(function() { return units.gu(5) });
73 titleBottomSpacing = 0;73 titleBottomSpacing = 0;
74 }74 }
75 } else { // portrait75 } else { // portrait
76 titleAreaHeight = units.gu(6);76 titleAreaHeight = Qt.binding(function() { return units.gu(6) });
77 if (hasSubtitle) {77 if (hasSubtitle) {
78 titleBottomSpacing = units.gu(1);78 titleBottomSpacing = Qt.binding(function() { return units.gu(1) });
79 } else {79 } else {
80 titleBottomSpacing = 0;80 titleBottomSpacing = 0;
81 }81 }
8282
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SheetForegroundStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/SheetForegroundStyle.qml 2015-04-25 07:36:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/SheetForegroundStyle.qml 2016-04-29 10:30:35 +0000
@@ -81,7 +81,7 @@
81 button.anchors.left = container.left;81 button.anchors.left = container.left;
82 button.anchors.right = container.right;82 button.anchors.right = container.right;
83 button.anchors.verticalCenter = container.verticalCenter;83 button.anchors.verticalCenter = container.verticalCenter;
84 button.anchors.margins = units.gu(1);84 button.anchors.margins = Qt.binding(function() { return units.gu(1) });
85 }85 }
8686
87 Connections {87 Connections {
8888
=== modified file 'src/Ubuntu/Components/plugin/label_p.h'
--- src/Ubuntu/Components/plugin/label_p.h 2016-03-11 19:28:41 +0000
+++ src/Ubuntu/Components/plugin/label_p.h 2016-04-29 10:30:35 +0000
@@ -47,7 +47,6 @@
47 };47 };
4848
49 UCLabel *q_ptr;49 UCLabel *q_ptr;
50 QFont defaultFont;
51 UCLabel::ColorProviderFunc defaultColor;50 UCLabel::ColorProviderFunc defaultColor;
52 UCLabel::TextSize textSize;51 UCLabel::TextSize textSize;
53 quint8 flags;52 quint8 flags;
5453
=== modified file 'src/Ubuntu/Components/plugin/uclabel.cpp'
--- src/Ubuntu/Components/plugin/uclabel.cpp 2016-04-20 15:00:27 +0000
+++ src/Ubuntu/Components/plugin/uclabel.cpp 2016-04-29 10:30:35 +0000
@@ -130,16 +130,14 @@
130 q->postThemeChanged();130 q->postThemeChanged();
131131
132 updatePixelSize();132 updatePixelSize();
133 defaultFont = q->font();133 QFont defaultFont = q->font();
134 defaultFont.setFamily("Ubuntu");134 defaultFont.setFamily("Ubuntu");
135 defaultFont.setWeight(QFont::Light);135 defaultFont.setWeight(QFont::Light);
136 q->setFont(defaultFont);136 q->setFont(defaultFont);
137 updateRenderType();137 updateRenderType();
138138
139 QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(updateRenderType()));139 QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(updateRenderType()));
140 QObject::connect(UCUnits::instance(), &UCUnits::gridUnitChanged, q, [this](){140 QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(updatePixelSize()));
141 updatePixelSize();
142 }, Qt::DirectConnection);
143141
144 QObject::connect(q, &UCLabel::enabledChanged, q, &UCLabel::postThemeChanged, Qt::DirectConnection);142 QObject::connect(q, &UCLabel::enabledChanged, q, &UCLabel::postThemeChanged, Qt::DirectConnection);
145143
@@ -202,7 +200,7 @@
202 Q_D(UCLabel);200 Q_D(UCLabel);
203 // we must restrict ourself to the pixelSize change as any font property change will201 // we must restrict ourself to the pixelSize change as any font property change will
204 // lead to the setter call.202 // lead to the setter call.
205 if (d->defaultFont.pixelSize() != font.pixelSize()) {203 if (this->font().pixelSize() != font.pixelSize()) {
206 d->flags |= UCLabelPrivate::PixelSizeSet;204 d->flags |= UCLabelPrivate::PixelSizeSet;
207 }205 }
208 QQuickText::setFont(font);206 QQuickText::setFont(font);
209207
=== modified file 'src/Ubuntu/Components/plugin/uclabel.h'
--- src/Ubuntu/Components/plugin/uclabel.h 2016-04-20 15:00:27 +0000
+++ src/Ubuntu/Components/plugin/uclabel.h 2016-04-29 10:30:35 +0000
@@ -91,6 +91,7 @@
91 Q_DECLARE_PRIVATE_D(d_ptr.data(), UCLabel)91 Q_DECLARE_PRIVATE_D(d_ptr.data(), UCLabel)
92 Q_DISABLE_COPY(UCLabel)92 Q_DISABLE_COPY(UCLabel)
93 Q_PRIVATE_SLOT(d_func(), void updateRenderType())93 Q_PRIVATE_SLOT(d_func(), void updateRenderType())
94 Q_PRIVATE_SLOT(d_func(), void updatePixelSize())
94};95};
9596
96QML_DECLARE_TYPE(UCLabel)97QML_DECLARE_TYPE(UCLabel)
9798
=== modified file 'tests/unit/tst_components/tst_label13.qml'
--- tests/unit/tst_components/tst_label13.qml 2016-03-14 18:56:42 +0000
+++ tests/unit/tst_components/tst_label13.qml 2016-04-29 10:30:35 +0000
@@ -158,6 +158,20 @@
158 verifyManualRenderType(textSetRenderType, Text.NativeRendering);158 verifyManualRenderType(textSetRenderType, Text.NativeRendering);
159 }159 }
160160
161 function test_colorGUPixelSize() {
162 units.gridUnit = 8;
163 textTestColorGUPixelSize.font.bold = true;
164 var pixelSizeAt8GU = textTestColorGUPixelSize.font.pixelSize;
165
166 units.gridUnit = 16;
167 textTestColorGUPixelSize.font.bold = false;
168 verify(textTestColorGUPixelSize.font.pixelSize > pixelSizeAt8GU);
169
170 units.gridUnit = 8;
171 textTestColorGUPixelSize.font.bold = true;
172 compare(textTestColorGUPixelSize.font.pixelSize, pixelSizeAt8GU);
173 }
174
161 Label {175 Label {
162 id: textCustom176 id: textCustom
163 }177 }
@@ -192,4 +206,8 @@
192 Label {206 Label {
193 id: textSetRenderType207 id: textSetRenderType
194 }208 }
209
210 Label {
211 id: textTestColorGUPixelSize
212 }
195}213}

Subscribers

People subscribed via source and target branches

to status/vote changes: