Merge lp:~tpeeters/ubuntu-ui-toolkit/optIn-newHeader into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Merged
Approved by: Zsombor Egri
Approved revision: 949
Merged at revision: 988
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/optIn-newHeader
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 304 lines (+45/-83)
5 files modified
components.api (+1/-0)
modules/Ubuntu/Components/MainView.qml (+42/-16)
modules/Ubuntu/Components/Toolbar.qml (+1/-1)
tests/unit/tst_components/tst_toolbaritems.qml (+1/-2)
tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml (+0/-64)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/optIn-newHeader
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+208662@code.launchpad.net

Commit message

Add useDeprecatedToolbar property to MainView which can be used to disable the current toolbar. Unsetting that property will in future also enable new features in the header.

Description of the change

Add bool to MainView to disable the old toolbar and use the new header functionality when it is done. Also add a position property to the Panel to make it more useful for implementing new bottom-edge behavior.

We need this so that app developers can disable the toolbar and implement their own new bottom-edge behavior, see http://design.canonical.com/2014/03/loving-the-bottom-edge/

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

Check out https://code.launchpad.net/~tpeeters/+junk/vscale to see an example of how the Panel can be used.

924. By Tim Peeters

update components.api

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

rename useOldToolbar to useDeprecatedToolbar

926. By Tim Peeters

only load toolbar when it is used

927. By Tim Peeters

update components.api

928. By Tim Peeters

toolbar always visible when loaded

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

remove initialization test that was only correct by luck/good timing

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

empty

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

merge trunk

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

huh? Why did jenkisn fail?

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

stop Loader from eating events

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

fix typo in Toolbar.qml comment

935. By Tim Peeters

fix parentage of toolbar

936. By Tim Peeters

merge trunk

937. By Tim Peeters

fix typo properly

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

Some failures in CI@home for unity8 and system settings: http://paste.ubuntu.com/7044989/
There is a bug in unity8 with qt5 that can cause these. Should be fixed with qt5.2.

938. By Tim Peeters

link bug

939. By Tim Peeters

merge trunk (translations only)

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

Things look good.

review: Approve
940. By Tim Peeters

merge trunk

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

merge trunk

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

merge trunk

943. By Tim Peeters

merge ima-bug1288876. See if jenkins CI passes now.

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

CI@home results:
- Several failures in music-app
- Several failures in ubuntu-clock-app
- Several failures in dialer-app: StateNotFoundError: Object not found with name '*' and properties {'objectName': 'historyList'}. (phone didn't have sim-card while testing)
- One error in unity8: unity8.indicators.tests.test_indicators.IndicatorTestCase.test_indicator_exists(Bluetooth) (phone has bluetooth disabled)

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

CI@home full results: http://paste.ubuntu.com/7111217/

944. By Tim Peeters

revert ima-bug1288876 merge

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

retry

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

previous CI failed because device screen unlock failed because the device was not 'clean' (left-over installed packages from another MR were there).

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

CI jobs fixed. retry

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

merge trunk

948. By Tim Peeters

re-adding InverseMouseAreaInListView.qml which got lost in the previous trunk merge

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: Approve (continuous-integration)
949. By Tim Peeters

merge translations from trunk

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

I don't know why the diff lists
237 === removed file 'tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml'
238 --- tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 2014-03-20 15:30:06 +0000
239 +++ tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 1970-01-01 00:00:00 +0000

and

168 === added file 'tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml'
169 --- tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 1970-01-01 00:00:00 +0000
170 +++ tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 2014-03-26 17:43:24 +0000

The supposedly removed and added files are identical. There was a conflict with that file when merging trunk but it seemed resolved.

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

ran clock-app tests 3 time without failures: http://paste.ubuntu.com/7184819/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2014-03-06 10:48:23 +0000
3+++ components.api 2014-03-26 17:43:24 +0000
4@@ -191,6 +191,7 @@
5 property color backgroundColor
6 property color footerColor
7 property bool automaticOrientation
8+ property bool useDeprecatedToolbar
9 default property internal contentsItem
10 property list<Action> actions
11 property UnityActions.ActionManager actionManager
12
13=== modified file 'modules/Ubuntu/Components/MainView.qml'
14--- modules/Ubuntu/Components/MainView.qml 2014-02-12 17:38:57 +0000
15+++ modules/Ubuntu/Components/MainView.qml 2014-03-26 17:43:24 +0000
16@@ -221,6 +221,16 @@
17 property alias automaticOrientation: canvas.automaticOrientation
18
19 /*!
20+ Setting this option will enable the old toolbar, and disable the new features
21+ that are being added to the new header. Unsetting it removes the toolbar and
22+ enables developers to have a sneak peek at the new features that are coming to
23+ the header, even before all the required functionality is implemented.
24+ This property will be deprecated after the new header implementation is done and
25+ all apps transitioned to using it. Default value: true.
26+ */
27+ property bool useDeprecatedToolbar: true
28+
29+ /*!
30 \internal
31 Use default property to ensure children added do not draw over the toolbar.
32 */
33@@ -266,7 +276,9 @@
34 fill: parent
35
36 // move the whole contents up if the toolbar is locked and opened otherwise the toolbar will obscure part of the contents
37- bottomMargin: toolbarItem.locked && toolbarItem.opened ? toolbarItem.height + toolbarItem.triggerSize : 0
38+ bottomMargin: mainView.useDeprecatedToolbar &&
39+ toolbarLoader.item.locked && toolbarLoader.item.opened ?
40+ toolbarLoader.item.height + toolbarLoader.item.triggerSize : 0
41 // compensate so that the actual y is always 0
42 topMargin: -parent.y
43 }
44@@ -282,9 +294,11 @@
45
46 onPressed: {
47 mouse.accepted = false;
48- if (!toolbarItem.locked) {
49- toolbarItem.close();
50+ if (mainView.useDeprecatedToolbar) {
51+ if (!toolbarLoader.item.locked) {
52+ toolbarLoader.item.close();
53 }
54+ }
55 if (headerItem.tabBar && !headerItem.tabBar.alwaysSelectionMode) {
56 headerItem.tabBar.selectionMode = false;
57 }
58@@ -298,15 +312,23 @@
59 */
60 property bool animate: true
61
62- Toolbar {
63- id: toolbarItem
64- onPressedChanged: {
65- if (!pressed) return;
66- if (headerItem.tabBar !== null) {
67- headerItem.tabBar.selectionMode = false;
68+ Component {
69+ id: toolbarComponent
70+ Toolbar {
71+ parent: canvas
72+ onPressedChanged: {
73+ if (!pressed) return;
74+ if (headerItem.tabBar !== null) {
75+ headerItem.tabBar.selectionMode = false;
76+ }
77 }
78+ animate: canvas.animate
79 }
80- animate: canvas.animate
81+ }
82+
83+ Loader {
84+ id: toolbarLoader
85+ sourceComponent: mainView.useDeprecatedToolbar ? toolbarComponent : null
86 }
87
88 /*!
89@@ -338,8 +360,10 @@
90 // no connections are made when target is null
91 target: headerItem.tabBar
92 onPressedChanged: {
93- if (headerItem.tabBar.pressed) {
94- if (!toolbarItem.locked) toolbarItem.close();
95+ if (mainView.useDeprecatedToolbar) {
96+ if (headerItem.tabBar.pressed) {
97+ if (!toolbarLoader.item.locked) toolbarLoader.item.close();
98+ }
99 }
100 }
101 }
102@@ -354,7 +378,9 @@
103 if (headerItem.tabBar) {
104 headerItem.tabBar.selectionMode = true;
105 }
106- if (!toolbarItem.locked) toolbarItem.open();
107+ if (mainView.useDeprecatedToolbar) {
108+ if (!toolbarLoader.item.locked) toolbarLoader.item.open();
109+ }
110 canvas.animate = true;
111 }
112 }
113@@ -386,8 +412,8 @@
114 UnityActions.ActionManager {
115 id: unityActionManager
116 onQuit: {
117- // FIXME Wire this up to the application lifecycle management API instead of quit().
118- Qt.quit()
119+ // FIXME Wire this up to the application lifecycle management API instead of quit().
120+ Qt.quit()
121 }
122 }
123 }
124@@ -405,7 +431,7 @@
125 The toolbar that will be propagated to the children in the page tree node.
126 It will be used by the active \l Page to set the toolbar actions.
127 */
128- property Toolbar toolbar: toolbarItem
129+ property Toolbar toolbar: toolbarLoader.item
130
131 /*!
132 \internal
133
134=== modified file 'modules/Ubuntu/Components/Toolbar.qml'
135--- modules/Ubuntu/Components/Toolbar.qml 2014-01-08 16:32:38 +0000
136+++ modules/Ubuntu/Components/Toolbar.qml 2014-03-26 17:43:24 +0000
137@@ -36,7 +36,7 @@
138 LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
139 LayoutMirroring.childrenInherit: true
140
141- // Closing of the toolbar on app contents ineraction is handled by the Page.
142+ // Closing of the toolbar on app contents interaction is handled by the Page.
143 __closeOnContentsClicks: false
144
145 /*!
146
147=== modified file 'tests/unit/tst_components/tst_toolbaritems.qml'
148--- tests/unit/tst_components/tst_toolbaritems.qml 2013-09-09 20:34:51 +0000
149+++ tests/unit/tst_components/tst_toolbaritems.qml 2014-03-26 17:43:24 +0000
150@@ -52,7 +52,6 @@
151
152 function initTestCase() {
153 compare(toolbarItems.pageStack, null, "pageStack initially null");
154- compare(toolbarItems.opened, false, "toolbar items closed by default");
155 compare(toolbarItems.locked, false, "toolbar items unlocked with children");
156 compare(emptyToolbarItems.locked, true, "toolbar items unlocked without visible children");
157 compare(toolbarItems.back === undefined, false, "back item set by default");
158@@ -61,7 +60,7 @@
159 }
160
161 function test_opened() {
162- compare(toolbarItems.opened, true, "Toolbar items initially opened");
163+ compare(toolbarItems.opened, true, "Toolbar items opened when page is first loaded");
164 toolbarItems.opened = false;
165 compare(toolbarItems.opened, false, "Toolbar items can be closed");
166 toolbarItems.opened = true;
167
168=== added file 'tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml'
169--- tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 1970-01-01 00:00:00 +0000
170+++ tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 2014-03-26 17:43:24 +0000
171@@ -0,0 +1,64 @@
172+/*
173+ * Copyright 2014 Canonical Ltd.
174+ *
175+ * This program is free software; you can redistribute it and/or modify
176+ * it under the terms of the GNU Lesser General Public License as published by
177+ * the Free Software Foundation; version 3.
178+ *
179+ * This program is distributed in the hope that it will be useful,
180+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
181+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
182+ * GNU Lesser General Public License for more details.
183+ *
184+ * You should have received a copy of the GNU Lesser General Public License
185+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
186+ */
187+
188+import QtQuick 2.0
189+import Ubuntu.Components 0.1
190+import Ubuntu.Components.ListItems 0.1
191+
192+MainView {
193+ id: root
194+ width: units.gu(40)
195+ height: units.gu(71)
196+
197+ property InverseMouseArea ima: null
198+
199+ Component {
200+ id: editor
201+ TextArea {
202+ }
203+ }
204+
205+ Page {
206+ title: "Test"
207+
208+ ListView {
209+ id: list
210+ objectName: "ListView"
211+ anchors.fill: parent
212+ model: 1
213+
214+ delegate: Empty {
215+ objectName: "Card"
216+ width: parent.width - units.gu(5)
217+ anchors.horizontalCenter: parent.horizontalCenter
218+ height: units.gu(50)
219+
220+ Loader {
221+ anchors.fill: parent
222+ sourceComponent: editor
223+ }
224+
225+ InverseMouseArea {
226+ id: imaItem
227+ objectName: "Test_IMA"
228+ anchors.fill: parent
229+ topmostItem: true
230+ Component.onCompleted: root.ima = imaItem
231+ }
232+ }
233+ }
234+ }
235+}
236
237=== removed file 'tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml'
238--- tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 2014-03-20 15:30:06 +0000
239+++ tests/unit_x11/tst_inversemousearea/InverseMouseAreaInListView.qml 1970-01-01 00:00:00 +0000
240@@ -1,64 +0,0 @@
241-/*
242- * Copyright 2014 Canonical Ltd.
243- *
244- * This program is free software; you can redistribute it and/or modify
245- * it under the terms of the GNU Lesser General Public License as published by
246- * the Free Software Foundation; version 3.
247- *
248- * This program is distributed in the hope that it will be useful,
249- * but WITHOUT ANY WARRANTY; without even the implied warranty of
250- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
251- * GNU Lesser General Public License for more details.
252- *
253- * You should have received a copy of the GNU Lesser General Public License
254- * along with this program. If not, see <http://www.gnu.org/licenses/>.
255- */
256-
257-import QtQuick 2.0
258-import Ubuntu.Components 0.1
259-import Ubuntu.Components.ListItems 0.1
260-
261-MainView {
262- id: root
263- width: units.gu(40)
264- height: units.gu(71)
265-
266- property InverseMouseArea ima: null
267-
268- Component {
269- id: editor
270- TextArea {
271- }
272- }
273-
274- Page {
275- title: "Test"
276-
277- ListView {
278- id: list
279- objectName: "ListView"
280- anchors.fill: parent
281- model: 1
282-
283- delegate: Empty {
284- objectName: "Card"
285- width: parent.width - units.gu(5)
286- anchors.horizontalCenter: parent.horizontalCenter
287- height: units.gu(50)
288-
289- Loader {
290- anchors.fill: parent
291- sourceComponent: editor
292- }
293-
294- InverseMouseArea {
295- id: imaItem
296- objectName: "Test_IMA"
297- anchors.fill: parent
298- topmostItem: true
299- Component.onCompleted: root.ima = imaItem
300- }
301- }
302- }
303- }
304-}

Subscribers

People subscribed via source and target branches

to status/vote changes: