Merge lp:~tpeeters/ubuntu-ui-toolkit/20-tabbarInStyle into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Approved by: Tim Peeters
Approved revision: 994
Merged at revision: 1018
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/20-tabbarInStyle
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~tpeeters/ubuntu-ui-toolkit/10-tabsModelIndex
Diff against target: 336 lines (+73/-46)
10 files modified
CHANGES (+2/-0)
components.api (+2/-0)
modules/Ubuntu/Components/Header.qml (+16/-3)
modules/Ubuntu/Components/MainView.qml (+3/-6)
modules/Ubuntu/Components/Tabs.qml (+13/-14)
modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml (+23/-1)
tests/resources/navigation/TabView.qml (+1/-9)
tests/unit/tst_components/tst_pagestack.qml (+3/-3)
tests/unit_x11/tst_components/tst_hide_chrome.qml (+1/-1)
tests/unit_x11/tst_components/tst_tabs.qml (+9/-9)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/20-tabbarInStyle
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+216712@code.launchpad.net

Commit message

Put the TabBar inside of the HeaderStyle instead of directly in the style.

Description of the change

Put the TabBar inside of the HeaderStyle instead of directly in the style.

To post a comment you must log in.
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)
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)
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)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

ubuntuuitoolkit AP tests pass except for one, but I confirmed that that one also fails in staging: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1311907

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

^ UITK AP tests on laptop (I did not test on device)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:993
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/77/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/390
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/5016
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-amd64-ci/77
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-armhf-ci/77
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-armhf-ci/77/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-i386-ci/77
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/357
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4627
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4627/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6331
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/4319
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5198
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5198/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/77/rebuild

review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
994. By Tim Peeters

merge staging

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

autolanding failed because the updated scripts for component.api landed in staging. Merged and re-happroved.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES'
2--- CHANGES 2014-04-23 18:25:19 +0000
3+++ CHANGES 2014-04-24 18:39:46 +0000
4@@ -96,6 +96,8 @@
5 * ADDED IN: Empty: property bool waitingConfirmationForRemoval
6 * ADDED IN: Empty: function cancelItemRemoval()
7 * CHANGED in CrossFadeImage: readonly property size sourceSize TO property size sourceSize
8+* DEPRECATED in Header: property Item contents
9+* DEPRECATED IN Tabs: property TabBar tabBar
10
11 Compatibility Breaks
12 ********************
13
14=== modified file 'components.api'
15--- components.api 2014-04-24 09:18:38 +0000
16+++ components.api 2014-04-24 18:39:46 +0000
17@@ -60,6 +60,7 @@
18 function hide()
19 property string title
20 property Item contents
21+ property var tabsModel
22 property Flickable flickable
23 Icon 0.1 1.0
24 Item
25@@ -420,6 +421,7 @@
26 default property list<Item> tabChildren
27 readonly property int count
28 signal modelChanged()
29+ property var __model
30 TextArea 0.1 1.0
31 StyledItem
32 property bool highlighted
33
34=== modified file 'modules/Ubuntu/Components/Header.qml'
35--- modules/Ubuntu/Components/Header.qml 2014-04-23 09:10:47 +0000
36+++ modules/Ubuntu/Components/Header.qml 2014-04-24 18:39:46 +0000
37@@ -50,7 +50,7 @@
38 internal.movementEnded();
39 }
40
41- visible: title || contents
42+ visible: title || contents || tabsModel
43 onVisibleChanged: {
44 internal.checkFlickableMargins();
45 }
46@@ -73,13 +73,26 @@
47 The text to display in the header
48 */
49 property string title: ""
50- onTitleChanged: contentsChanged()
51+ onTitleChanged: {
52+ header.show();
53+ }
54
55 /*!
56+ \deprecated
57 The contents of the header. If this is set, \l title will be ignored.
58+ This property is now DEPRECATED. Set tabsModel to show tabs navigation in header.
59 */
60 property Item contents: null
61- onContentsChanged: header.show()
62+ onContentsChanged: {
63+ print("Header.contents property is now DEPRECATED. Set tabsModel to show tabs navigation.");
64+ header.show();
65+ }
66+
67+ /*!
68+ A model of tabs to represent in the header.
69+ This is automatically set by \l Tabs.
70+ */
71+ property var tabsModel: null
72
73 /*!
74 The flickable that controls the movement of the header.
75
76=== modified file 'modules/Ubuntu/Components/MainView.qml'
77--- modules/Ubuntu/Components/MainView.qml 2014-04-20 19:25:12 +0000
78+++ modules/Ubuntu/Components/MainView.qml 2014-04-24 18:39:46 +0000
79@@ -349,12 +349,9 @@
80 Binding {
81 target: headerItem
82 property: "tabBar"
83- value: headerItem.contents
84- when: headerItem.contents &&
85- headerItem.contents.hasOwnProperty("selectionMode") &&
86- headerItem.contents.hasOwnProperty("alwaysSelectionMode") &&
87- headerItem.contents.hasOwnProperty("selectedIndex") &&
88- headerItem.contents.hasOwnProperty("pressed")
89+ value: headerItem.__styleInstance.__tabBar
90+ when: headerItem.__styleInstance &&
91+ headerItem.__styleInstance.hasOwnProperty("__tabBar")
92 }
93
94 Connections {
95
96=== modified file 'modules/Ubuntu/Components/Tabs.qml'
97--- modules/Ubuntu/Components/Tabs.qml 2014-04-23 15:20:44 +0000
98+++ modules/Ubuntu/Components/Tabs.qml 2014-04-24 18:39:46 +0000
99@@ -176,14 +176,14 @@
100 readonly property Item currentPage: selectedTab ? selectedTab.page : null
101
102 /*!
103+ \deprecated
104 The \l TabBar that will be shown in the header
105 and provides scrollable tab buttons.
106+ This property is DEPRECATED. TabBar is now part of the header style.
107 */
108- property TabBar tabBar: TabBar {
109- id: bar
110- model: tabsModel
111- visible: tabs.active
112- }
113+ property TabBar tabBar: internal.header && internal.header.__styleInstance &&
114+ internal.header.__styleInstance.hasOwnProperty("__tabBar") ?
115+ internal.header.__styleInstance.__tabBar : null
116
117 /*!
118 Children are placed in a separate item that has functionality to extract the Tab items.
119@@ -207,6 +207,12 @@
120
121 /*!
122 \internal
123+ tst_tabs.qml needs access to the model to verify that Repeaters inside Tabs works.
124+ */
125+ property var __model: tabsModel
126+
127+ /*!
128+ \internal
129 required by TabsStyle
130 */
131 ListModel {
132@@ -299,13 +305,6 @@
133 id: internal
134 property Header header: tabs.__propagated ? tabs.__propagated.header : null
135
136- Binding {
137- target: tabBar
138- property: "animate"
139- when: internal.header && internal.header.hasOwnProperty("animate")
140- value: internal.header.animate
141- }
142-
143 /*
144 List of connected Repeaters to avoid repeater "hammering" of itemAdded() signal.
145 */
146@@ -446,8 +445,8 @@
147
148 Binding {
149 target: internal.header
150- property: "contents"
151- value: tabs.active ? tabs.tabBar: null
152+ property: "tabsModel"
153+ value: tabsModel
154 when: internal.header && tabs.active
155 }
156 }
157
158=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml'
159--- modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml 2014-04-20 19:25:12 +0000
160+++ modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml 2014-04-24 18:39:46 +0000
161@@ -43,6 +43,12 @@
162
163 implicitHeight: headerStyle.contentHeight + separator.height + separatorBottom.height
164
165+ /*!
166+ \internal
167+ Tabs needs to call sync of the TabBar
168+ */
169+ property TabBar __tabBar: tabBarLoader.sourceComponent ? tabBarLoader.item : null
170+
171 BorderImage {
172 id: separator
173 anchors {
174@@ -81,7 +87,7 @@
175 }
176 text: styledItem.title
177 font.weight: headerStyle.fontWeight
178- visible: !styledItem.contents
179+ visible: !styledItem.tabsModel && !styledItem.contents
180 fontSize: headerStyle.fontSize
181 color: headerStyle.textColor
182 }
183@@ -98,5 +104,21 @@
184 value: foreground
185 when: styledItem.contents
186 }
187+
188+ Loader {
189+ id: tabBarLoader
190+ sourceComponent: styledItem.tabsModel && !styledItem.contents ? tabBarComponent : null
191+ anchors.fill: parent
192+ }
193+
194+ Component {
195+ id: tabBarComponent
196+ TabBar {
197+ id: tabBar
198+ anchors.fill: parent
199+ model: styledItem.tabsModel
200+ animate: styledItem.animate
201+ }
202+ }
203 }
204 }
205
206=== modified file 'tests/resources/navigation/TabView.qml'
207--- tests/resources/navigation/TabView.qml 2014-04-23 15:20:44 +0000
208+++ tests/resources/navigation/TabView.qml 2014-04-24 18:39:46 +0000
209@@ -45,15 +45,7 @@
210
211 Header {
212 id: header
213- contents: TabBar {
214- id: tabBar
215- model: pages
216- anchors {
217- top: parent.top
218- left: parent.left
219- right: parent.right
220- }
221- }
222+ tabsModel: pages
223 }
224
225 Component {
226
227=== modified file 'tests/unit/tst_components/tst_pagestack.qml'
228--- tests/unit/tst_components/tst_pagestack.qml 2014-04-20 19:25:12 +0000
229+++ tests/unit/tst_components/tst_pagestack.qml 2014-04-24 18:39:46 +0000
230@@ -85,14 +85,14 @@
231 pageStack.push(tabs);
232 compare(pageStack.currentPage, tabs, "Tabs can be pushed on a PageStack");
233 compare(tabs.active, true, "Tabs on top of a PageStack are active");
234- compare(mainView.__propagated.header.contents, tabs.tabBar, "Pushing Tabs on PageStack updates the header contents");
235+ compare(mainView.__propagated.header.__styleInstance.__tabBar, tabs.tabBar, "Pushing Tabs on PageStack updates the header contents");
236 pageStack.push(page1);
237 compare(pageStack.currentPage, page1, "A page can be pushed on top of a Tabs");
238 compare(tabs.active, false, "Tabs on a PageStack, but not on top, are inactive");
239- compare(mainView.__propagated.header.contents, null, "Contents of inactive Tabs is not applied to header");
240+ compare(mainView.__propagated.header.__styleInstance.__tabBar, null, "Contents of inactive Tabs is not applied to header");
241 pageStack.pop();
242 compare(tabs.active, true, "Tabs on top of PageStack is active");
243- compare(mainView.__propagated.header.contents, tabs.tabBar, "Active Tabs controls header contents");
244+ compare(mainView.__propagated.header.__styleInstance.__tabBar, tabs.tabBar, "Active Tabs controls header contents");
245 pageStack.clear();
246 }
247
248
249=== modified file 'tests/unit_x11/tst_components/tst_hide_chrome.qml'
250--- tests/unit_x11/tst_components/tst_hide_chrome.qml 2014-04-20 19:25:12 +0000
251+++ tests/unit_x11/tst_components/tst_hide_chrome.qml 2014-04-24 18:39:46 +0000
252@@ -72,7 +72,7 @@
253 function setTabBarSelectionMode(newSelectionMode) {
254 var tabBar = tabs.tabBar;
255 var header = mainView.__propagated.header;
256- compare(tabBar, header.contents, "TabBar is not the active header contents");
257+ compare(tabBar, header.__styleInstance.__tabBar, "TabBar is not the active header contents");
258 header.show();
259 tabBar.selectionMode = newSelectionMode;
260 compare(tabBar.selectionMode, newSelectionMode, "Failed to set the tab bar selection mode");
261
262=== modified file 'tests/unit_x11/tst_components/tst_tabs.qml'
263--- tests/unit_x11/tst_components/tst_tabs.qml 2014-04-20 19:25:12 +0000
264+++ tests/unit_x11/tst_components/tst_tabs.qml 2014-04-24 18:39:46 +0000
265@@ -216,7 +216,7 @@
266 The following testcases are all related to bug #1253804
267 */
268 function test_tabOrder_bug1253804() {
269- var tabsModel = tabsWithRepeater.tabBar.model;
270+ var tabsModel = tabsWithRepeater.__model;
271
272 compare(tabsRepeater.count, inputModel.count, "Incorrect number of tabs in Tabs");
273 compare(tabsModel.count, tabsRepeater.count, "Incorrect number of tabs in TabBar");
274@@ -236,12 +236,12 @@
275
276 // set it to null
277 tabsRepeater.model = null;
278- compare(tabsWithRepeater.tabBar.model.count, 0, "There are still tabs left after repeater model is reset");
279+ compare(tabsWithRepeater.__model.count, 0, "There are still tabs left after repeater model is reset");
280 }
281
282 function test_repeaterTabs() {
283 repeater.model = inputModel;
284- var tabsModel = repeaterTabs.tabBar.model;
285+ var tabsModel = repeaterTabs.__model;
286
287 compare(repeater.count, inputModel.count, "Incorrect number of tabs in Tabs");
288 compare(tabsModel.count, repeater.count, "Incorrect number of tabs in TabBar");
289@@ -251,12 +251,12 @@
290
291 // clear repeaterTabs
292 repeater.model = null;
293- compare(repeaterTabs.tabBar.model.count, 0, "There are still tabs left after repeater model is reset");
294+ compare(repeaterTabs.__model.count, 0, "There are still tabs left after repeater model is reset");
295 }
296
297 function test_repeaterTabs_arrayAsModel() {
298 repeater.model = testCase.listModel;
299- var tabsModel = repeaterTabs.tabBar.model;
300+ var tabsModel = repeaterTabs.__model;
301
302 compare(repeater.count, testCase.listModel.length, "Incorrect number of tabs in Tabs");
303 compare(tabsModel.count, repeater.count, "Incorrect number of tabs in TabBar");
304@@ -275,12 +275,12 @@
305
306 // clear repeaterTabs
307 repeater.model = null;
308- compare(repeaterTabs.tabBar.model.count, 0, "There are still tabs left after repeater model is reset");
309+ compare(repeaterTabs.__model.count, 0, "There are still tabs left after repeater model is reset");
310
311 }
312
313 function test_twoRepeaters() {
314- var tabsModel = twoRepeaters.tabBar.model;
315+ var tabsModel = twoRepeaters.__model;
316 var secondRepeaterModel = secondRepeater.model;
317
318 compare(tabsModel.count, firstRepeater.count + secondRepeater.count, "Incorrect number of tabs in TabBar");
319@@ -293,7 +293,7 @@
320 }
321
322 function test_twinRepeaters() {
323- var tabsModel = twinRepeaters.tabBar.model;
324+ var tabsModel = twinRepeaters.__model;
325
326 compare(twinRepeater1.count, twinModel.count, "Incorrect number of tabs in the first repeater");
327 compare(twinRepeater2.count, twinModel.count, "Incorrect number of tabs in the second repeater");
328@@ -324,7 +324,7 @@
329 // set it to null
330 twinRepeater1.model = null;
331 twinRepeater2.model = null;
332- compare(twinRepeaters.tabBar.model.count, 0, "There are still tabs left after repeater model is reset");
333+ compare(twinRepeaters.__model.count, 0, "There are still tabs left after repeater model is reset");
334 }
335
336 function test_emptyTabs() {

Subscribers

People subscribed via source and target branches