2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU 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 General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 function insertItem(index, size, type) {
30 insert(index, { size: size, type: type });
33 function removeItems(index, count) {
37 function moveItems(indexFrom, indexTo, count) {
38 move(indexFrom, indexTo, count);
41 ListElement { type: "Agressive"; size: 150 }
42 ListElement { type: "Regular"; size: 200 }
43 ListElement { type: "Mild"; size: 350 }
44 ListElement { type: "Bold"; size: 350 }
45 ListElement { type: "Bold"; size: 350 }
46 ListElement { type: "Lazy"; size: 350 }
49 ListViewWithPageHeader {
52 anchors.top: parent.top
53 anchors.bottom: parent.bottom
56 property bool timerDone: false
57 width: parent.width - 20
59 color: index % 2 == 0 ? "red" : "blue"
66 pageHeader: Rectangle {
78 sectionProperty: "type"
80 property int sectionHeaderHeight: 40
81 sectionDelegate: Component {
82 id: sectionHeaderComponent
85 height: listView.sectionHeaderHeight
86 Text { text: section; font.pixelSize: 34 }
87 anchors { left: parent.left; right: parent.right }
93 id: otherSectionHeaderComponent
97 Text { text: section; font.pixelSize: 34 }
98 anchors { left: parent.left; right: parent.right }
103 id: stickyHeaderHeigthSpy
105 signalName: "stickyHeaderHeightChanged"
109 name: "ListViewWithPageHeaderTest"
112 function test_stickyHeaderHeightNewHeader() {
113 stickyHeaderHeigthSpy.clear();
114 compare(listView.stickyHeaderHeight, 40);
116 listView.sectionDelegate = otherSectionHeaderComponent;
117 compare(listView.stickyHeaderHeight, 50);
118 compare(stickyHeaderHeigthSpy.count, 1);
120 listView.sectionDelegate = sectionHeaderComponent;
121 compare(listView.stickyHeaderHeight, 40);
122 compare(stickyHeaderHeigthSpy.count, 2);
125 function test_stickyHeaderHeightGrowingHeader() {
126 stickyHeaderHeigthSpy.clear();
128 compare(listView.stickyHeaderHeight, 40);
130 listView.sectionHeaderHeight = 60;
131 compare(listView.stickyHeaderHeight, 60);
132 compare(stickyHeaderHeigthSpy.count, 1);
134 // Restore height for other tests
135 listView.sectionHeaderHeight = 40;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list