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

Proposed by Tim Peeters
Status: Merged
Approved by: Tim Peeters
Approved revision: 1187
Merged at revision: 1188
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/pagestack-anchors
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 47 lines (+37/-0)
1 file modified
modules/Ubuntu/Components/PageStack.qml (+37/-0)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/pagestack-anchors
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+230443@code.launchpad.net

Commit message

Document the default anchors of PageStack.

Description of the change

Document the default anchors of PageStack.

To post a comment you must log in.
Revision history for this message
Zsombor Egri (zsombi) wrote :

Yeah, looks reasonable. We should have these mentioned everywhere we do set anchors.fill. Nice one.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/PageStack.qml'
2--- modules/Ubuntu/Components/PageStack.qml 2014-05-27 13:47:27 +0000
3+++ modules/Ubuntu/Components/PageStack.qml 2014-08-12 10:03:24 +0000
4@@ -32,6 +32,43 @@
5 of the stack. When more than one Pages are on the stack, the toolbar will
6 automatically feature a back-button that pop the stack when triggered.
7
8+ The anchors of the PageStack are set to fill its parent by default. To use
9+ left/right/top/bottom anchors, explicitly set anchors.fill of the PageStack to
10+ undefined:
11+ \qml
12+ import QtQuick 2.2
13+ import Ubuntu.Components 1.1
14+
15+ MainView {
16+ width: units.gu(40)
17+ height: units.gu(71)
18+
19+ PageStack {
20+ id: mainStack
21+ anchors {
22+ fill: undefined // unset the default to make the other anchors work
23+ left: parent.left
24+ right: parent.right
25+ top: parent.top
26+ bottom: rect.top
27+ }
28+ }
29+
30+ Rectangle {
31+ id: rect
32+ color: UbuntuColors.red
33+ anchors {
34+ left: parent.left
35+ right: parent.right
36+ bottom: parent.bottom
37+ }
38+ height: units.gu(10)
39+ }
40+
41+ Component.onCompleted: mainStack.push(Qt.resolvedUrl("MyPage.qml"))
42+ }
43+ \endqml
44+
45 Pages that are defined inside the PageStack must initially set their visibility
46 to false to avoid the pages occluding the PageStack before they are pushed.
47 When pushing a \l Page, its visibility is automatically updated.

Subscribers

People subscribed via source and target branches