2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
import Ubuntu.Test 1.3
19
import Ubuntu.Components 1.3
20
import Ubuntu.Components.Labs 1.0
32
onTriggered: splitView.columns = 4
36
onTriggered: splitView.columns = 2
45
topMargin: sections.height
47
property int columns: 4
52
when: splitView.columns == 4
54
preferredWidth: units.gu(40)
55
maximumWidth: units.gu(100)
59
minimumWidth: units.gu(10)
60
maximumWidth: units.gu(150)
63
preferredWidth: units.gu(50)
67
minimumWidth: units.gu(15)
71
when: splitView.columns == 2
73
preferredWidth: units.gu(10)
74
minimumWidth: units.gu(30)
78
minimumWidth: units.gu(40)
85
model: splitView.columns
87
objectName: "column" + index
88
color: UbuntuColors.red
89
height: splitView.height
98
splitView.columns = 0;
101
function test_children_data() {
103
{tag: "4 columns", columns: 4, childCount: 5, children: ["column0", "column1", "column2", "column3", "ignored"]},
104
{tag: "2 columns", columns: 2, childCount: 3, children: ["column0", "column1", "ignored"]},
105
{tag: "0 columns", columns: 0, childCount: 1, children: ["ignored"]},
108
function test_children(data) {
109
splitView.columns = data.columns;
110
compare(splitView.children.length, data.childCount);
111
for (var i in splitView.children) {
112
compare(splitView.children[i].objectName, data.children[i]);