Merge lp:~tpeeters/ubuntu-ui-toolkit/rtm-fit-finish into lp:ubuntu-ui-toolkit

Proposed by Renato Araujo Oliveira Filho
Status: Rejected
Rejected by: Tim Peeters
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/rtm-fit-finish
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 424 lines (+196/-37)
5 files modified
modules/Ubuntu/Components/AppHeader.qml (+5/-0)
modules/Ubuntu/Components/MainView.qml (+1/-0)
modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml (+169/-22)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py (+2/-2)
tests/resources/header/header.qml (+19/-13)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/rtm-fit-finish
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+227696@code.launchpad.net

Commit message

Fit and Finish sprint

To post a comment you must log in.
1155. By Tim Peeters

Don't automatically close a Panel when the user presses next to it, and update Panel position when its height changes.

1156. By Tim Peeters

update font sizes

1157. By Tim Peeters

Various design tweaks:
- Update CheckBox/Switch colors
- Use new header by default in UITK gallery
- Add margins for left and rightmost buttons in header

1158. By Tim Peeters

Push modules/Ubuntu/Components/qmldir in push_to_phone.sh

1159. By Tim Peeters

workaround for large-timestamp autopilot bug

1160. By Tim Peeters

New sizes for icons and touch areas in header.

1161. By Zoltan Balogh

Wrap tempfile.NamedTemporaryFile to discard underscored filenames

1162. By Zoltan Balogh

Sync from the trunk

1163. By Tim Peeters

NEW BRANCH from staging

1164. By Tim Peeters

header height

1165. By Tim Peeters

header animations

1166. By Tim Peeters

remove back button when not visible

1167. By Tim Peeters

header section visuals

1168. By Tim Peeters

stroke button

1169. By Tim Peeters

revert stroke button

Unmerged revisions

1169. By Tim Peeters

revert stroke button

1168. By Tim Peeters

stroke button

1167. By Tim Peeters

header section visuals

1166. By Tim Peeters

remove back button when not visible

1165. By Tim Peeters

header animations

1164. By Tim Peeters

header height

1163. By Tim Peeters

NEW BRANCH from staging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/AppHeader.qml'
2--- modules/Ubuntu/Components/AppHeader.qml 2014-07-17 10:59:18 +0000
3+++ modules/Ubuntu/Components/AppHeader.qml 2014-07-28 10:04:09 +0000
4@@ -37,6 +37,11 @@
5 */
6 property bool animate: true
7
8+ /*!
9+ Animate changing to new title/actions inside the header.
10+ */
11+ property bool animateContents: false
12+
13 Behavior on y {
14 enabled: animate && !(header.flickable && header.flickable.moving)
15 SmoothedAnimation {
16
17=== modified file 'modules/Ubuntu/Components/MainView.qml'
18--- modules/Ubuntu/Components/MainView.qml 2014-07-14 20:16:24 +0000
19+++ modules/Ubuntu/Components/MainView.qml 2014-07-28 10:04:09 +0000
20@@ -341,6 +341,7 @@
21 id: headerItem
22 property real bottomY: headerItem.y + headerItem.height
23 animate: canvas.animate
24+ animateContents: canvas.animate
25
26 title: internal.activePage ? internal.activePage.title : ""
27 flickable: internal.activePage ? internal.activePage.flickable : null
28
29=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml'
30--- modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-22 15:15:28 +0000
31+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-28 10:04:09 +0000
32@@ -21,7 +21,7 @@
33
34 Style.PageHeadStyle {
35 id: headerStyle
36- contentHeight: units.gu(7.5)
37+ contentHeight: units.gu(7)
38 separatorSource: "artwork/PageHeaderBaseDividerLight.sci"
39 separatorBottomSource: "artwork/PageHeaderBaseDividerBottom.png"
40 fontWeight: Font.Light
41@@ -32,6 +32,109 @@
42
43 implicitHeight: headerStyle.contentHeight + separator.height + separatorBottom.height
44
45+ Component.onCompleted: {
46+ buffer.config = styledItem.config;
47+ buffer.title = styledItem.title;
48+ }
49+
50+ Object {
51+ id: buffer
52+
53+ property PageHeadConfiguration config
54+ property string title
55+
56+ // Calling changeAnimation.start() a second time has no effect,
57+ // so below we call it whenever something changes.
58+ Connections {
59+ target: styledItem
60+ onConfigChanged: buffer.updateConfigAndTitle()
61+ onTitleChanged: buffer.updateConfigAndTitle()
62+ }
63+
64+ function updateConfigAndTitle() {
65+ if (styledItem.animateContents) {
66+ changeAnimation.start();
67+ } else {
68+ buffer.config = styledItem.config;
69+ buffer.title = styledItem.title;
70+ }
71+ }
72+
73+ SequentialAnimation {
74+ id: changeAnimation
75+ ParallelAnimation {
76+ UbuntuNumberAnimation {
77+ target: foreground
78+ property: "opacity"
79+ from: 1.0
80+ to: 0.0
81+ }
82+ UbuntuNumberAnimation {
83+ target: leftButtonContainer
84+ property: "opacity"
85+ from: 1.0
86+ to: 0.0
87+ }
88+ UbuntuNumberAnimation {
89+ target: actionsContainer
90+ property: "opacity"
91+ from: 1.0
92+ to: 0.0
93+ }
94+ UbuntuNumberAnimation {
95+ target: leftAnchor
96+ properties: "anchors.leftMargin"
97+ from: 0.0
98+ to: -units.gu(5)
99+ }
100+ UbuntuNumberAnimation {
101+ target: rightAnchor
102+ properties: "anchors.rightMargin"
103+ from: 0
104+ to: -units.gu(5)
105+ }
106+ }
107+ ScriptAction {
108+ script: {
109+ buffer.config = styledItem.config;
110+ buffer.title = styledItem.title;
111+ }
112+ }
113+ ParallelAnimation {
114+ UbuntuNumberAnimation {
115+ target: foreground
116+ property: "opacity"
117+ from: 0.0
118+ to: 1.0
119+ }
120+ UbuntuNumberAnimation {
121+ target: leftButtonContainer
122+ property: "opacity"
123+ from: 0.0
124+ to: 1.0
125+ }
126+ UbuntuNumberAnimation {
127+ target: actionsContainer
128+ property: "opacity"
129+ from: 0.0
130+ to: 1.0
131+ }
132+ UbuntuNumberAnimation {
133+ target: leftAnchor
134+ properties: "anchors.leftMargin"
135+ from: -units.gu(5)
136+ to: 0
137+ }
138+ UbuntuNumberAnimation {
139+ target: rightAnchor
140+ properties: "anchors.rightMargin"
141+ from: -units.gu(5)
142+ to: 0
143+ }
144+ }
145+ }
146+ }
147+
148 // FIXME: Workaround to get sectionsRepeater.count in autopilot tests,
149 // see also FIXME in AppHeader where this property is used.
150 property alias __sections_repeater_for_autopilot: sectionsRepeater
151@@ -44,13 +147,15 @@
152 right: parent.right
153 }
154 source: headerStyle.separatorSource
155+ height: sectionsRow.visible ? units.gu(3) : units.gu(2)
156
157- property PageHeadSections sections: styledItem.config.sections
158+ property PageHeadSections sections: buffer.config.sections
159
160 Row {
161 id: sectionsRow
162- property int itemWidth: sectionsRow.width / sectionsRepeater.count
163- anchors.fill: parent
164+ anchors.centerIn: parent
165+ width: childrenRect.width
166+ height: parent.height
167 enabled: separator.sections.enabled
168 visible: separator.sections.model !== undefined
169 opacity: enabled ? 1.0 : 0.5
170@@ -60,22 +165,42 @@
171 model: separator.sections.model
172 objectName: "page_head_sections_repeater"
173 AbstractButton {
174+ Rectangle {
175+ anchors.fill: parent
176+// color: Qt.rgba(1.0, 0.0, 0.0, 0.2)
177+ color: "transparent"
178+ }
179+
180 id: sectionButton
181+ anchors.verticalCenter: parent ? parent.verticalCenter : undefined
182 objectName: "section_button_" + index
183 enabled: sectionsRow.enabled
184- width: sectionsRow.itemWidth
185- height: sectionsRow.height
186+ width: label.width + units.gu(3)
187+ height: sectionsRow.height + units.gu(2)
188 property bool selected: index === separator.sections.selectedIndex
189 onClicked: separator.sections.selectedIndex = index;
190
191 Label {
192+ id: label
193 text: modelData
194 fontSize: "small"
195- anchors.fill: parent
196+ anchors.centerIn: sectionButton
197 horizontalAlignment: Text.AlignHCenter
198 color: sectionButton.selected ?
199- Theme.palette.normal.backgroundText :
200- Theme.palette.selected.backgroundText
201+ UbuntuColors.orange :
202+ UbuntuColors.darkGrey
203+ }
204+
205+ Rectangle {
206+ anchors {
207+ verticalCenter: parent.verticalCenter
208+ right: parent.right
209+ }
210+ height: units.dp(10)
211+ width: units.dp(1)
212+ visible: index < sectionsRepeater.model.length - 1
213+ color: UbuntuColors.darkGrey
214+ opacity: 0.2
215 }
216 }
217 }
218@@ -92,9 +217,30 @@
219 }
220
221 Item {
222+ id: leftAnchor
223+ anchors {
224+ top: parent.top
225+ bottom: parent.bottom
226+ left: parent.left
227+ leftMargin: 0
228+ }
229+ width: 0
230+ }
231+ Item {
232+ id: rightAnchor
233+ anchors {
234+ top: parent.top
235+ bottom: parent.bottom
236+ right: parent.right
237+ rightMargin: 0
238+ }
239+ width: 0
240+ }
241+
242+ Item {
243 id: leftButtonContainer
244 anchors {
245- left: parent.left
246+ left: leftAnchor.right
247 top: parent.top
248 leftMargin: width > 0 ? units.gu(1) : 0
249 }
250@@ -104,9 +250,9 @@
251 PageHeadButton {
252 id: customBackButton
253 objectName: "customBackButton"
254- action: styledItem.config.backAction
255- visible: null !== styledItem.config.backAction &&
256- styledItem.config.backAction.visible
257+ action: buffer.config.backAction
258+ visible: null !== buffer.config.backAction &&
259+ buffer.config.backAction.visible
260 }
261
262 PageHeadButton {
263@@ -117,7 +263,8 @@
264 visible: styledItem.pageStack !== null &&
265 styledItem.pageStack !== undefined &&
266 styledItem.pageStack.depth > 1 &&
267- !customBackButton.visible
268+ !customBackButton.visible &&
269+ !styledItem.config.backAction
270
271 text: "back"
272
273@@ -173,12 +320,12 @@
274 id: foreground
275 anchors {
276 left: leftButtonContainer.right
277- right: actionsContainer.left
278 top: parent.top
279 // don't keep a margin if there is already a button with spacing
280 leftMargin: leftButtonContainer.width > 0 ? 0 : headerStyle.textLeftMargin
281 }
282 height: headerStyle.contentHeight
283+ width: parent.width - leftButtonContainer.width - actionsContainer.width
284
285 Label {
286 objectName: "header_title_label"
287@@ -189,7 +336,7 @@
288 right: parent.right
289 verticalCenter: parent.verticalCenter
290 }
291- text: styledItem.title
292+ text: buffer.title
293 font.weight: headerStyle.fontWeight
294 fontSize: headerStyle.fontSize
295 color: headerStyle.textColor
296@@ -202,7 +349,7 @@
297 // when the bindings below is no longer active
298 id: contentsContainer
299 anchors.fill: parent
300- visible: styledItem.contents || styledItem.config.contents
301+ visible: styledItem.contents || buffer.config.contents
302 }
303 Binding {
304 target: styledItem.contents
305@@ -217,17 +364,17 @@
306 when: styledItem.contents
307 }
308 Binding {
309- target: styledItem.config.contents
310+ target: buffer.config.contents
311 property: "parent"
312 value: contentsContainer
313- when: styledItem.config.contents && !styledItem.contents
314+ when: buffer.config.contents && !styledItem.contents
315 }
316 }
317
318 Row {
319 id: actionsContainer
320
321- property var visibleActions: getVisibleActions(styledItem.config.actions)
322+ property var visibleActions: getVisibleActions(buffer.config.actions)
323 function getVisibleActions(actions) {
324 var visibleActionList = [];
325 for (var i in actions) {
326@@ -251,7 +398,7 @@
327
328 anchors {
329 top: parent.top
330- right: parent.right
331+ right: rightAnchor.left
332 rightMargin: units.gu(1)
333 }
334 width: childrenRect.width
335@@ -286,7 +433,7 @@
336 // onClicked is executed. See bug
337 // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1326963
338 Connections {
339- target: styledItem.config
340+ target: buffer.config
341 onActionsChanged: {
342 actionsOverflowPopover.hide();
343 }
344
345=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py'
346--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py 2014-06-02 23:21:48 +0000
347+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py 2014-07-28 10:04:09 +0000
348@@ -24,8 +24,8 @@
349
350
351 TEST_TABS_QML_FORMAT = ("""
352-import QtQuick 2.0
353-import Ubuntu.Components 1.0
354+import QtQuick 2.2
355+import Ubuntu.Components 1.1
356
357 MainView {{
358 width: units.gu(70)
359
360=== modified file 'tests/resources/header/header.qml'
361--- tests/resources/header/header.qml 2014-07-17 14:30:45 +0000
362+++ tests/resources/header/header.qml 2014-07-28 10:04:09 +0000
363@@ -29,6 +29,7 @@
364 Component.onCompleted: stack.push(tabs)
365 Tabs {
366 id: tabs
367+ selectedTabIndex: 5
368 Tab {
369 title: "Stack"
370 page: Page {
371@@ -37,14 +38,21 @@
372 text: "Click me"
373 onTriggered: stack.push(pageOnStack)
374 }
375- tools: ToolbarItems {
376- ToolbarButton {
377- action: Action {
378- iconName: "settings"
379- text: "Settings"
380- }
381+ head {
382+ actions: Action {
383+ iconName: "settings"
384+ text: "Settings"
385 }
386 }
387+
388+// tools: ToolbarItems {
389+// ToolbarButton {
390+// action: Action {
391+// iconName: "settings"
392+// text: "Settings"
393+// }
394+// }
395+// }
396 }
397 }
398 Tab {
399@@ -184,7 +192,7 @@
400 id: sectionsPage
401 head {
402 sections {
403- model: ["navy", "lightblue", "brown", "cyan", "darkgrey"]
404+ model: ["navy", "lightblue", "brown"]
405 }
406 }
407 Rectangle {
408@@ -207,12 +215,10 @@
409 anchors.centerIn: parent
410 text: "Use back button to return"
411 }
412- tools: ToolbarItems {
413- ToolbarButton {
414- action: Action {
415- iconName: "settings"
416- text: "settings"
417- }
418+ head {
419+ actions: Action {
420+ iconName: "settings"
421+ text: "settings"
422 }
423 }
424 }

Subscribers

People subscribed via source and target branches

to status/vote changes: