45
height: childrenRect.height
49
onClicked: layout.addPageToCurrentColumn(rootPage, leftPage)
52
text: "Add page right"
53
onClicked: layout.addPageToNextColumn(rootPage, rightPage)
56
text: "Add sections page right"
57
onClicked: layout.addPageToNextColumn(rootPage, sectionsPage)
60
text: "Add external page right"
61
onClicked: layout.addPageToNextColumn(
62
rootPage, Qt.resolvedUrl("MyExternalPage.DEPRECATED_APPHEADER.qml"))
65
text: "Add page with head contents left"
66
onClicked: layout.addPageToCurrentColumn(rootPage, headContentsPage)
69
text: "Add page with head contents right"
70
onClicked: layout.addPageToNextColumn(rootPage, headContentsPage)
73
text: "Add page with header left"
74
onClicked: layout.addPageToCurrentColumn(rootPage, pageWithHeader)
77
text: "Add page with header right"
78
onClicked: layout.addPageToNextColumn(rootPage, pageWithHeader)
42
contentWidth: parent.width
43
contentHeight: pagesColumn.height
52
height: childrenRect.height
56
onClicked: layout.addPageToCurrentColumn(rootPage, leftPage)
59
text: "Add page right"
60
onClicked: layout.addPageToNextColumn(rootPage, rightPage)
63
text: "Add sections page right"
64
onClicked: layout.addPageToNextColumn(rootPage, sectionsPage)
67
text: "Add external page right"
68
onClicked: layout.addPageToNextColumn(
69
rootPage, Qt.resolvedUrl("MyExternalPage.DEPRECATED_APPHEADER.qml"))
72
text: "Add page with head contents left"
73
onClicked: layout.addPageToCurrentColumn(rootPage, headContentsPage)
76
text: "Add page with head contents right"
77
onClicked: layout.addPageToNextColumn(rootPage, headContentsPage)
80
text: "Add page with header left"
81
onClicked: layout.addPageToCurrentColumn(rootPage, pageWithHeader)
84
text: "Add page with header right"
85
onClicked: layout.addPageToNextColumn(rootPage, pageWithHeader)
88
text: "Add page with no automatic header height left"
89
onClicked: layout.addPageToCurrentColumn(rootPage, pageNoAutomaticHeaderHeight)
92
text: "Add page with no automatic header height right"
93
onClicked: layout.addPageToNextColumn(rootPage, pageNoAutomaticHeaderHeight)
177
id: pageNoAutomaticHeaderHeight
179
title: "Page with no automatic header height"
181
backgroundColor: UbuntuColors.green
182
foregroundColor: "white"
183
contentHeight: units.gu(7) // 1 GU more than the default
185
automaticHeight: false
189
top: pageNoAutomaticHeaderHeight.header.bottom
192
bottom: parent.bottom
195
color: UbuntuColors.warmGrey
197
anchors.centerIn: parent
198
text: "Add sections to next column."
199
onTriggered: layout.addPageToNextColumn(pageNoAutomaticHeaderHeight, sectionsPage)
371
414
"Page header height is not reverted when header with sections is removed from next column.");
417
function test_pageheader_no_automatic_height_bug1540240() {
418
if (root.columns !== 2) {
419
skip("Only for wide view.");
422
// baseHeight was checked in test_subheader_height().
423
var baseHeight = get_header(0).height;
425
layout.addPageToNextColumn(rootPage, pageNoAutomaticHeaderHeight);
426
compare(baseHeight === pageNoAutomaticHeaderHeight.header.height, false,
427
"This test makes no sense if pageNoAutomaticHeaderHeight.header.height is the default height.");
428
compare(get_header(0).height, baseHeight,
429
"Page header with no automatic height affects header height in other column.");
430
layout.removePages(pageNoAutomaticHeaderHeight);
431
compare(get_header(0).height, baseHeight,
432
"Removing page with no automatic header height changes header height in other column.");
434
layout.addPageToCurrentColumn(rootPage, pageNoAutomaticHeaderHeight);
435
baseHeight = get_header(0).height;
436
layout.addPageToNextColumn(rootPage, sectionsPage);
438
// withSectionsHeight was checked in test_subheader_height().
439
var withSectionsHeight = get_header(1).height;
440
compare(withSectionsHeight > baseHeight, true,
441
"Header with sections is not more than 1 GU higher than header without sections.");
442
compare(pageNoAutomaticHeaderHeight.header.height, baseHeight,
443
"Page header with no automatic height adapts its height to header with sections in other column.");
445
layout.removePages(sectionsPage);
446
compare(pageNoAutomaticHeaderHeight.header.height, baseHeight,
447
"Page header with no automatic height is changed when header with sections is removed from next column.");
374
450
function test_back_button_wide() {
375
451
// FIXME: When we remove support for the old subHeader and all
376
452
// pages use a PageHeader, the repeated tests for PageHeader below