Merge lp:~tpeeters/ubuntu-ui-toolkit/headercontents into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Approved by: Cris Dywan
Approved revision: 1621
Merged at revision: 1621
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/headercontents
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 67 lines (+32/-1)
2 files modified
src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+1/-1)
tests/unit_x11/tst_components/tst_multicolumnheader.qml (+31/-0)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/headercontents
Reviewer Review Type Date Requested Status
Cris Dywan Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+269436@code.launchpad.net

Commit message

Don't unset the subheader style when Page.head changes because that unsets the parent of Page.head.contents.

To post a comment you must log in.
1621. By Tim Peeters

update comment

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

That looks sensible.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
2--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-08-17 09:49:23 +0000
3+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-08-27 21:11:48 +0000
4@@ -537,7 +537,7 @@
5 }
6 height: body.headerHeight
7
8- styleName: config ? "PageHeadStyle" : ""
9+ styleName: "PageHeadStyle"
10 theme.version: Ubuntu.toolkitVersion
11 objectName: "Header" + column
12
13
14=== modified file 'tests/unit_x11/tst_components/tst_multicolumnheader.qml'
15--- tests/unit_x11/tst_components/tst_multicolumnheader.qml 2015-07-28 15:04:07 +0000
16+++ tests/unit_x11/tst_components/tst_multicolumnheader.qml 2015-08-27 21:11:48 +0000
17@@ -61,6 +61,14 @@
18 onClicked: layout.addPageToNextColumn(
19 rootPage, Qt.resolvedUrl("MyExternalPage.qml"))
20 }
21+ ListItemWithLabel {
22+ text: "Add page with head contents left"
23+ onClicked: layout.addPageToCurrentColumn(rootPage, headContentsPage)
24+ }
25+ ListItemWithLabel {
26+ text: "Add page with head contents right"
27+ onClicked: layout.addPageToNextColumn(rootPage, headContentsPage)
28+ }
29 }
30 }
31 Page {
32@@ -108,6 +116,14 @@
33 color: "blue"
34 }
35 }
36+ Page {
37+ id: headContentsPage
38+ head.contents: Rectangle {
39+ id: headRectangle
40+ color: UbuntuColors.orange
41+ anchors.fill: parent
42+ }
43+ }
44 }
45
46 UbuntuTestCase {
47@@ -340,5 +356,20 @@
48 compare(get_back_button_visible(0), false,
49 "Back button remains visible after removing page from following column.");
50 }
51+
52+ function test_head_contents_visible_bug1488922() {
53+ layout.addPageToCurrentColumn(rootPage, headContentsPage);
54+ // The bug occurred when the style for the subheader was unset
55+ // after a short delay, so wait before testing Page.head.contents.parent.
56+ wait(100);
57+ compare(headRectangle.visible, true, "Head contents not visible in current column.");
58+ compare(headRectangle.parent == null, false, "Head contents has no parent in current column.");
59+ layout.removePages(headContentsPage);
60+ layout.addPageToNextColumn(rootPage, headContentsPage);
61+ wait(100);
62+ compare(headRectangle.visible, true, "Head contents not visible in next column.");
63+ compare(headRectangle.parent == null, false, "Head contents has no parent in next column.");
64+ layout.removePages(headContentsPage);
65+ }
66 }
67 }

Subscribers

People subscribed via source and target branches