Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/lessColumnApi into lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/multiColumnView

Proposed by Cris Dywan
Status: Merged
Approved by: Tim Peeters
Approved revision: 1546
Merge reported by: Cris Dywan
Merged at revision: not available
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/lessColumnApi
Merge into: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/multiColumnView
Diff against target: 488 lines (+71/-158)
5 files modified
components.api (+0/-8)
modules/Ubuntu/Components/1.3/ColumnMetrics.qml (+3/-2)
modules/Ubuntu/Components/1.3/MultiColumnView.qml (+67/-137)
modules/Ubuntu/Components/qmldir (+0/-1)
tests/unit_x11/tst_components/tst_multicolumnview.qml (+1/-10)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/lessColumnApi
Reviewer Review Type Date Requested Status
Tim Peeters Approve
Review via email: mp+262641@code.launchpad.net

Commit message

Remove advanced MultiColumnView API

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

28 === modified file 'modules/Ubuntu/Components/1.3/ColumnMetrics.qml'

Docs should be marked \internal

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

tst_multicolumnview.qml doesn't show anything when I run it with launcher, but that may also be broken in zsombi's multicolumnview branch.

Revision history for this message
Cris Dywan (kalikiana) wrote :

> tst_multicolumnview.qml doesn't show anything when I run it with launcher, but
> that may also be broken in zsombi's multicolumnview branch.

It does. You can see the separator. But as the columns have no contents that's all you see.

I'll add some colors.

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

yeah ok. I see now that the separator is there. No need for colors.

I'll add some contents when I merge the splitHeader.

1546. By Cris Dywan

Explicitly mark ColumnMetrics as internal

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

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2015-06-17 14:22:56 +0000
+++ components.api 2015-06-24 16:16:33 +0000
@@ -204,11 +204,6 @@
204 function clear()204 function clear()
205 function QQuickMimeData* newData()205 function QQuickMimeData* newData()
206Ubuntu.Components.ColorUtils 0.1 1.0206Ubuntu.Components.ColorUtils 0.1 1.0
207Ubuntu.Components.ColumnMetrics 1.3: QtObject
208 property int column
209 property bool fillWidth
210 property double maximumWidth
211 property double minimumWidth
212Ubuntu.Components.ComboButton 1.1: Button207Ubuntu.Components.ComboButton 1.1: Button
213 property double collapsedHeight208 property double collapsedHeight
214 default readonly property QtObject comboList209 default readonly property QtObject comboList
@@ -527,10 +522,7 @@
527 AfterItem522 AfterItem
528 BeforeItem523 BeforeItem
529Ubuntu.Components.MultiColumnView 1.3: PageTreeNode524Ubuntu.Components.MultiColumnView 1.3: PageTreeNode
530 readonly property ColumnMetrics columnMetrics
531 property int columns
532 default readonly property QtObject data525 default readonly property QtObject data
533 property double defaultColumnWidth
534 function var addPageToCurrentColumn(var sourcePage, var page, var properties)526 function var addPageToCurrentColumn(var sourcePage, var page, var properties)
535 function var addPageToNextColumn(var sourcePage, var page, var properties)527 function var addPageToNextColumn(var sourcePage, var page, var properties)
536 function var removePages(var page)528 function var removePages(var page)
537529
=== modified file 'modules/Ubuntu/Components/1.3/ColumnMetrics.qml'
--- modules/Ubuntu/Components/1.3/ColumnMetrics.qml 2015-06-17 09:32:02 +0000
+++ modules/Ubuntu/Components/1.3/ColumnMetrics.qml 2015-06-24 16:16:33 +0000
@@ -22,6 +22,7 @@
22 \since Ubuntu.Components 1.322 \since Ubuntu.Components 1.3
23 \ingroup ubuntu23 \ingroup ubuntu
24 \brief Component configuring the metrics of a column in MultiColumnView.24 \brief Component configuring the metrics of a column in MultiColumnView.
25 \internal
2526
26 */27 */
27QtObject {28QtObject {
@@ -38,14 +39,14 @@
3839
39 /*!40 /*!
40 Specifies the minimum width of the column. If the value is greater than41 Specifies the minimum width of the column. If the value is greater than
41 \l MultiColumnView::defaultColumnWidth, the value will be set as width for42 \b MultiColumnView::defaultColumnWidth, the value will be set as width for
42 the column.43 the column.
43 */44 */
44 property real minimumWidth: 045 property real minimumWidth: 0
4546
46 /*!47 /*!
47 Specifies the maximum width of the column. If the value is smaller than48 Specifies the maximum width of the column. If the value is smaller than
48 \l MultiColumnView::defaultColumnWidth, the value will be set as width for49 \b MultiColumnView::defaultColumnWidth, the value will be set as width for
49 the column. A maximum value of 0 will be ignored.50 the column. A maximum value of 0 will be ignored.
50 */51 */
51 property real maximumWidth: Number.POSITIVE_INFINITY52 property real maximumWidth: Number.POSITIVE_INFINITY
5253
=== modified file 'modules/Ubuntu/Components/1.3/MultiColumnView.qml'
--- modules/Ubuntu/Components/1.3/MultiColumnView.qml 2015-06-17 14:22:56 +0000
+++ modules/Ubuntu/Components/1.3/MultiColumnView.qml 2015-06-24 16:16:33 +0000
@@ -46,7 +46,7 @@
46 a Page instance, a Component or a url to a document defining a Page. The page46 a Page instance, a Component or a url to a document defining a Page. The page
47 cannot be removed from the view.47 cannot be removed from the view.
4848
49 \note Unlike PageStack, the component does not fill its parent content.49 \note Unlike PageStack or Page the component does not fill its parent by default.
5050
51 \qml51 \qml
52 import QtQuick 2.452 import QtQuick 2.4
@@ -58,7 +58,6 @@
5858
59 MultiColumnView {59 MultiColumnView {
60 anchors.fill: parent60 anchors.fill: parent
61 columns: 2
62 primaryPage: page161 primaryPage: page1
63 Page {62 Page {
64 id: page163 id: page1
@@ -86,40 +85,8 @@
86 }85 }
87 \endqml86 \endqml
8887
89 Column widths are controlled by the \l defaultColumnWidth property and the \l columnMetrics88 MultiColumnView supports adaptive column handling. When the number of columns changes at
90 properties. The \l columnMetrics contains a list of metrics configuring a specific89 runtime the pages are automatically rearranged. To understand it better, let's take the following example:
91 column. If no metrics are set, the component will use \l defaultColumnWidth on
92 each column. If the component is set to have one column only, the content will
93 be stretched to the entire component area no matter of the metrics specified.
94 When multiple columns are set, the last column is set to fill the available
95 width and the rest are configured with the \l defaultColumnWidth. This behavior
96 can be changed by specifying the \l ColumnMetrics::fillWidth for the column that
97 needs to fill the available width. There can be more columns filling the available
98 width at a time.
99
100 Let's modify the example above, to have 3 columns, where columns 1 and 3
101 should have fixed widths of 40 GU and column 2 should fill to the space
102 available. The code handling this would look as follows:
103 \qml
104 MultiColumnView {
105 columns: 3
106 defaultColumnWidth: units.gu(40)
107 columnMetrics: [
108 ColumnMetrics {
109 column: 2
110 fillWidth: true
111 },
112 ColumnMetrics {
113 column: 3
114 fillWidth: false
115 }
116 ]
117 }
118 \endqml
119
120 MultiColumnView supports adaptive column handling. When columns number changes
121 runtime, the pages are automatically rearranged to the closest columns they were
122 added to. To understand it better, let's take the following example:
123 \qml90 \qml
124 import QtQuick 2.491 import QtQuick 2.4
125 import Ubuntu.Components 1.392 import Ubuntu.Components 1.3
@@ -130,8 +97,6 @@
13097
131 MultiColumnView {98 MultiColumnView {
132 anchors.fill: parent99 anchors.fill: parent
133 columns: width > units.gu(100) ? 3 :
134 (width >= units.gu(80) ? 2 : 1)
135 primaryPage: page1100 primaryPage: page1
136 Page {101 Page {
137 id: page1102 id: page1
@@ -157,20 +122,21 @@
157 }122 }
158 \endqml123 \endqml
159124
160 When the code is run on desktop, it will launch with a space for three columns.125 When the code is run on sufficiently wide screen, like a desktop or TV,
126 it will launch with multiple columns.
127
161 \c page1 is set to be the primary page, \c page2 will be added to column next to128 \c page1 is set to be the primary page, \c page2 will be added to column next to
162 \c page1 (to column 2) and \c page3 next to \c page2 (column 3). When the window129 \c page1 (to column 2) and \c page3 next to \c page2 (column 3). When the window
163 is resized to have its size below 100 GU, the component will switch to 2 column130 is resized to have its size below 80 GU, the component will switch to 1 column
164 mode, and \c page3 will be placed in the last column, and the header for \c page2131 mode, and \c page3 will be placed in the last column, and the header for \c page2
165 will have a back button, indicating that there is a page below it. If the window132 will have a back button, indicating that there is a page below it. If the window
166 is resized to contain only one column, all pages will be shown in that column, so133 is resized to contain only one column, all pages will be shown in that column, so
167 the component will act as PageStack. Resizing the window back to 2 respectively134 the component will act as PageStack. Resizing the window back to 2 columns will place the pages side-by-side.
168 3 columns will place the pages side-by-side.
169135
170 \note In the above example if \c page2 is removed, that will remove all its child136 \note In the above example if \c page2 is removed, that will remove all its child
171 pages, meaning \c page3 will also be removed.137 pages, meaning \c page3 will also be removed.
172138
173 \sa PageStack, ColumnMetrics139 \sa PageStack
174*/140*/
175141
176PageTreeNode {142PageTreeNode {
@@ -179,67 +145,21 @@
179 /*!145 /*!
180 The property holds the first Page which will be added to the view. If the146 The property holds the first Page which will be added to the view. If the
181 view has more than one column, the page will be added to the leftmost column.147 view has more than one column, the page will be added to the leftmost column.
182 The proeprty can hold either a Page instance, a component holding a Page148 The property can hold either a Page instance, a component holding a Page
183 or a QML document defining the Page. The property cannot be changed after149 or a QML document defining the Page. The property cannot be changed after
184 component completion.150 component completion.
185 */151 */
186 property var primaryPage152 property var primaryPage
187153
188 /*!154 /*!
189 Specifies the number of columns in the view. A condition must be set to
190 control the number of columns depending on the space available.
191 \qml
192 MultiColumnView {
193 id: view
194 columns: view.width > units.gu(50) ? 2 : 1
195 }
196 \endqml
197 */
198 property int columns: 1
199
200 /*!
201 The property specifies the default width of each column. The property is
202 applied on each column. If the \a minimumWidth specified for the column is
203 bigger than this value, the minimum width will be applied.
204 */
205 property real defaultColumnWidth: units.gu(40)
206
207 /*!
208 The property configures the size constraints and area filling for columns.
209 If a column is not specified, the default sizing and filling will be applied.
210 By default, only the last column is filling the available width, al other
211 columns are sized to \l defaultColumnWidth as maximum. By default the list
212 is empty. Only columns requiring special handling than the default should
213 be specified.
214 */
215 property list<ColumnMetrics> columnMetrics
216
217 /*!
218 \qmlmethod Item addPageToCurrentColumn(Item sourcePage, var page[, var properties])155 \qmlmethod Item addPageToCurrentColumn(Item sourcePage, var page[, var properties])
219 Adds a \c page to the column the \c sourcePage resides in. If \c sourcePage156 Adds a \c page to the column the \c sourcePage resides in. \c page can be a
220 is null, the \c page will be added to the leftmost column. \c page can be a157 Component or a file. \c properties is a JSON object containing properties
221 Component or a file. \c properties is a JSon object containing properties
222 to be set when page is created. \c sourcePage must be active. Returns the158 to be set when page is created. \c sourcePage must be active. Returns the
223 instance of the page created.159 instance of the page created.
224 */160 */
225 function addPageToCurrentColumn(sourcePage, page, properties) {161 function addPageToCurrentColumn(sourcePage, page, properties) {
226 if (columns <= 0) {162 return d.addPageToColumn(d.columnForPage(sourcePage), sourcePage, page, properties);
227 return;
228 }
229 if (!sourcePage) {
230 console.warn("No sourcePage specified. Page will not be added.");
231 return;
232 }
233 if (!d.stack.find(sourcePage)) {
234 console.warn("sourcePage must be added to the view to add new page.");
235 return;
236 }
237
238 var wrapper = d.createWrapper(page, properties);
239 wrapper.column = d.columnForPage(sourcePage);
240 wrapper.parentPage = sourcePage;
241 d.addPage(wrapper);
242 return wrapper.object;
243 }163 }
244164
245 /*!165 /*!
@@ -250,28 +170,12 @@
250 rightmost column, the new page will be pushed to the same column as \c sourcePage.170 rightmost column, the new page will be pushed to the same column as \c sourcePage.
251 */171 */
252 function addPageToNextColumn(sourcePage, page, properties) {172 function addPageToNextColumn(sourcePage, page, properties) {
253 if (columns <= 0) {173 return d.addPageToColumn(d.columnForPage(sourcePage) + 1, sourcePage, page, properties);
254 return;
255 }
256 if (!sourcePage) {
257 console.warn("No sourcePage specified. Page will not be added.");
258 return;
259 }
260 if (!d.stack.find(sourcePage)) {
261 console.warn("sourcePage must be added to the view to add new page.");
262 return;
263 }
264
265 var wrapper = d.createWrapper(page, properties);
266 wrapper.column = (!sourcePage) ? 0 : d.columnForPage(sourcePage) + 1;
267 wrapper.parentPage = sourcePage;
268 d.addPage(wrapper);
269 return wrapper.object;
270 }174 }
271175
272 /*!176 /*!
273 \qmlmethod void removePages(Item page)177 \qmlmethod void removePages(Item page)
274 The function removes and deletes all pages from the view columns until \c page178 The function removes and deletes all pages up to and including \c page
275 is reached. If the \a page is the same as the \l primaryPage, only its child179 is reached. If the \a page is the same as the \l primaryPage, only its child
276 pages will be removed.180 pages will be removed.
277 */181 */
@@ -292,13 +196,6 @@
292 internals196 internals
293 */197 */
294198
295 /*! internal */
296 onColumnsChanged: {
297 if (columns <= 0) {
298 console.warn("There must me a minimum of one column set.");
299 }
300 d.relayout();
301 }
302 Component.onCompleted: {199 Component.onCompleted: {
303 d.relayout();200 d.relayout();
304 d.completed = true;201 d.completed = true;
@@ -315,7 +212,6 @@
315 return;212 return;
316 }213 }
317 }214 }
318 onDefaultColumnWidthChanged: body.applyMetrics()
319215
320 QtObject {216 QtObject {
321 id: d217 id: d
@@ -323,6 +219,19 @@
323 property bool completed: false219 property bool completed: false
324 property var stack: new Stack.Stack()220 property var stack: new Stack.Stack()
325221
222 property int columns: multiColumnView.width >= units.gu(80) ? 2 : 1
223 /*! internal */
224 onColumnsChanged: {
225 if (columns <= 0) {
226 console.warn("There must be a minimum of one column set.");
227 columns = 1;
228 }
229 d.relayout();
230 }
231 property real defaultColumnWidth: units.gu(40)
232 onDefaultColumnWidthChanged: body.applyMetrics()
233 property list<ColumnMetrics> columnMetrics
234
326 function createWrapper(page, properties) {235 function createWrapper(page, properties) {
327 var wrapperComponent = Qt.createComponent("PageWrapper.qml");236 var wrapperComponent = Qt.createComponent("PageWrapper.qml");
328 var wrapperObject = wrapperComponent.createObject(hiddenPages);237 var wrapperObject = wrapperComponent.createObject(hiddenPages);
@@ -337,7 +246,7 @@
337 function addPage(pageWrapper) {246 function addPage(pageWrapper) {
338 stack.push(pageWrapper);247 stack.push(pageWrapper);
339 pageWrapper.parentWrapper = stack.find(pageWrapper.parentPage);248 pageWrapper.parentWrapper = stack.find(pageWrapper.parentPage);
340 var targetColumn = MathUtils.clamp(pageWrapper.column, 0, columns - 1);249 var targetColumn = MathUtils.clamp(pageWrapper.column, 0, d.columns - 1);
341 // replace page holder's child250 // replace page holder's child
342 var holder = body.children[targetColumn];251 var holder = body.children[targetColumn];
343 holder.detachCurrentPage();252 holder.detachCurrentPage();
@@ -349,10 +258,31 @@
349 return wrapper ? wrapper.column : 0;258 return wrapper ? wrapper.column : 0;
350 }259 }
351260
261 function addPageToColumn(column, sourcePage, page, properties) {
262 if (column < 0) {
263 console.warn("Column must be >= 0.");
264 return;
265 }
266 if (!sourcePage) {
267 console.warn("No sourcePage specified. Page will not be added.");
268 return;
269 }
270 if (!d.stack.find(sourcePage)) {
271 console.warn("sourcePage must be added to the view to add new page.");
272 return;
273 }
274
275 var wrapper = d.createWrapper(page, properties);
276 wrapper.parentPage = sourcePage;
277 wrapper.column = column;
278 d.addPage(wrapper);
279 return wrapper.object;
280 }
281
352 // node is a triplet of {page, column, parentPage}282 // node is a triplet of {page, column, parentPage}
353 function popAndSetPageForColumn(node) {283 function popAndSetPageForColumn(node) {
354 stack.pop();284 stack.pop();
355 var effectiveColumn = MathUtils.clamp(node.column, 0, columns - 1);285 var effectiveColumn = MathUtils.clamp(node.column, 0, d.columns - 1);
356 var columnHolder = body.children[effectiveColumn];286 var columnHolder = body.children[effectiveColumn];
357 // is the page in a column?287 // is the page in a column?
358 if (node == columnHolder.pageWrapper) {288 if (node == columnHolder.pageWrapper) {
@@ -360,7 +290,7 @@
360 columnHolder.detachCurrentPage();290 columnHolder.detachCurrentPage();
361 }291 }
362 node.parent = null;292 node.parent = null;
363 var prevPage = stack.topForColumn(effectiveColumn, effectiveColumn < columns - 1);293 var prevPage = stack.topForColumn(effectiveColumn, effectiveColumn < d.columns - 1);
364 if (prevPage) {294 if (prevPage) {
365 columnHolder.attachPage(prevPage);295 columnHolder.attachPage(prevPage);
366 }296 }
@@ -371,10 +301,10 @@
371301
372 // relayouts when column count changes302 // relayouts when column count changes
373 function relayout() {303 function relayout() {
374 if (body.children.length == columns) return;304 if (body.children.length == d.columns) return;
375 if (body.children.length > columns) {305 if (body.children.length > d.columns) {
376 // need to remove few columns, the last ones306 // need to remove few columns, the last ones
377 while (body.children.length > columns) {307 while (body.children.length > d.columns) {
378 var holder = body.children[body.children.length - 1];308 var holder = body.children[body.children.length - 1];
379 holder.detachCurrentPage();309 holder.detachCurrentPage();
380 holder.parent = null;310 holder.parent = null;
@@ -384,7 +314,7 @@
384 var prevColumns = body.children.length;314 var prevColumns = body.children.length;
385315
386 // add columns316 // add columns
387 for (var i = 0; i < columns - prevColumns; i++) {317 for (var i = 0; i < d.columns - prevColumns; i++) {
388 pageHolderComponent.createObject(body);318 pageHolderComponent.createObject(body);
389 }319 }
390 }320 }
@@ -392,9 +322,9 @@
392 }322 }
393323
394 function rearrangePages() {324 function rearrangePages() {
395 for (var column = columns - 1; column >= 0; column--) {325 for (var column = d.columns - 1; column >= 0; column--) {
396 var holder = body.children[column];326 var holder = body.children[column];
397 var pageWrapper = stack.topForColumn(column, column < (columns - 1));327 var pageWrapper = stack.topForColumn(column, column < (d.columns - 1));
398 if (!pageWrapper) {328 if (!pageWrapper) {
399 continue;329 continue;
400 }330 }
@@ -426,8 +356,8 @@
426 Component {356 Component {
427 id: defaultMetrics357 id: defaultMetrics
428 ColumnMetrics {358 ColumnMetrics {
429 fillWidth: column == columns359 fillWidth: column == d.columns
430 minimumWidth: defaultColumnWidth360 minimumWidth: d.defaultColumnWidth
431 }361 }
432 }362 }
433363
@@ -446,8 +376,8 @@
446 Layout.fillWidth: metrics.fillWidth376 Layout.fillWidth: metrics.fillWidth
447 Layout.fillHeight: true377 Layout.fillHeight: true
448 Layout.preferredWidth: metrics.maximumWidth > 0 ?378 Layout.preferredWidth: metrics.maximumWidth > 0 ?
449 MathUtils.clamp(defaultColumnWidth, metrics.minimumWidth, metrics.maximumWidth) :379 MathUtils.clamp(d.defaultColumnWidth, metrics.minimumWidth, metrics.maximumWidth) :
450 defaultColumnWidth380 d.defaultColumnWidth
451 Layout.minimumWidth: metrics.minimumWidth381 Layout.minimumWidth: metrics.minimumWidth
452 Layout.maximumWidth: metrics.maximumWidth382 Layout.maximumWidth: metrics.maximumWidth
453383
@@ -476,7 +406,7 @@
476 bottom: parent.bottom406 bottom: parent.bottom
477 right: parent.right407 right: parent.right
478 }408 }
479 width: (column == (columns - 1)) || !pageWrapper ? 0 : units.dp(2)409 width: (column == (d.columns - 1)) || !pageWrapper ? 0 : units.dp(2)
480 color: theme.palette.normal.background410 color: theme.palette.normal.background
481 }411 }
482412
@@ -491,11 +421,11 @@
491 }421 }
492422
493 function attachPage(page) {423 function attachPage(page) {
494 if (!page) return;
495 pageWrapper = page;424 pageWrapper = page;
496 pageWrapper.parent = holderBody;425 pageWrapper.parent = holderBody;
497 pageWrapper.pageHolder = holder;426 pageWrapper.pageHolder = holder;
498 pageWrapper.active = true;427 pageWrapper.active = true;
428
499 if (pageWrapper.object.hasOwnProperty("head")) {429 if (pageWrapper.object.hasOwnProperty("head")) {
500 header.config = pageWrapper.object.head;430 header.config = pageWrapper.object.head;
501 }431 }
@@ -553,9 +483,9 @@
553 var holder = children[i];483 var holder = children[i];
554 // search for the column metrics484 // search for the column metrics
555 var metrics = null;485 var metrics = null;
556 for (var j = 0; j < columnMetrics.length; j++) {486 for (var j = 0; j < d.columnMetrics.length; j++) {
557 if (columnMetrics[j].column == (i + 1)) {487 if (d.columnMetrics[j].column == (i + 1)) {
558 metrics = columnMetrics[j];488 metrics = d.columnMetrics[j];
559 break;489 break;
560 }490 }
561 }491 }
562492
=== modified file 'modules/Ubuntu/Components/qmldir'
--- modules/Ubuntu/Components/qmldir 2015-06-17 09:32:02 +0000
+++ modules/Ubuntu/Components/qmldir 2015-06-24 16:16:33 +0000
@@ -141,4 +141,3 @@
141UbuntuListView 1.3 1.3/UbuntuListView11.qml141UbuntuListView 1.3 1.3/UbuntuListView11.qml
142Captions 1.3 1.3/Captions.qml142Captions 1.3 1.3/Captions.qml
143MultiColumnView 1.3 1.3/MultiColumnView.qml143MultiColumnView 1.3 1.3/MultiColumnView.qml
144ColumnMetrics 1.3 1.3/ColumnMetrics.qml
145144
=== modified file 'tests/unit_x11/tst_components/tst_multicolumnview.qml'
--- tests/unit_x11/tst_components/tst_multicolumnview.qml 2015-06-17 14:22:56 +0000
+++ tests/unit_x11/tst_components/tst_multicolumnview.qml 2015-06-24 16:16:33 +0000
@@ -29,7 +29,6 @@
29 width: parent.width29 width: parent.width
30 height: parent.height30 height: parent.height
3131
32 columns: width > units.gu(100) ? 3 : (width > units.gu(80) ? 2 : 1)
33 primaryPage: page132 primaryPage: page1
3433
35 Page {34 Page {
@@ -68,10 +67,7 @@
68 }67 }
6968
70 function test_0_API() {69 function test_0_API() {
71 compare(defaults.columns, 1, "wrong columns");70 compare(defaults.primaryPage, undefined, "primaryPage not undefined by default");
72 compare(defaults.defaultColumnWidth, units.gu(40), "wrong defaultColumnWidth");
73 compare(defaults.columnMetrics.length, 0, "wrong columnMetrics list");
74 compare(defaults.primaryPage, undefined, "wrong primaryPage");
75 }71 }
7672
77 function test_add_to_first_column_data() {73 function test_add_to_first_column_data() {
@@ -114,11 +110,6 @@
114 verify(secondColumn.pageWrapper);110 verify(secondColumn.pageWrapper);
115 }111 }
116112
117 function test_invalid_column() {
118 ignoreWarning("There must me a minimum of one column set.");
119 defaults.columns = 0;
120 }
121
122 function test_change_primaryPage() {113 function test_change_primaryPage() {
123 ignoreWarning("Cannot change primaryPage after completion.");114 ignoreWarning("Cannot change primaryPage after completion.");
124 testView.primaryPage = page3;115 testView.primaryPage = page3;

Subscribers

People subscribed via source and target branches

to all changes: