Merge lp:~tpeeters/ubuntu-ui-toolkit/noBackButton into lp:ubuntu-ui-toolkit/staging
- noBackButton
- Merge into staging
Status: | Merged |
---|---|
Approved by: | Cris Dywan |
Approved revision: | 1171 |
Merged at revision: | 1170 |
Proposed branch: | lp:~tpeeters/ubuntu-ui-toolkit/noBackButton |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Prerequisite: | lp:~tpeeters/ubuntu-ui-toolkit/iconFix |
Diff against target: |
135 lines (+106/-3) 3 files modified
modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml (+2/-2) modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml (+1/-1) tests/unit_x11/tst_components/tst_headActions.qml (+103/-0) |
To merge this branch: | bzr merge lp:~tpeeters/ubuntu-ui-toolkit/noBackButton |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Cris Dywan | Approve | ||
Review via email: mp+228836@code.launchpad.net |
This proposal supersedes a proposal from 2014-07-28.
Commit message
Allow app developers to disable the back button by setting an invisible back action for the page.
Description of the change
Allow app developers to disable the back button by setting an invisible back action for the page.
Use case: dialer app pushes call page on the pagestack when in a phone call, but the user cannot use the 'back' button to leave the call page. When the phone call is terminated, the call page is popped from the pagestack.
Leo Arias (elopio) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1163
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1166
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Cris Dywan (kalikiana) wrote : Posted in a previous version of this proposal | # |
QWARN : components:
Cris Dywan (kalikiana) wrote : Posted in a previous version of this proposal | # |
Looks good.
I've seen the warning in another branch - I wonder if we're missing a dependency somewhere, though the package depends on suru-icon-theme already.
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal | # |
> Looks good.
>
> I've seen the warning in another branch - I wonder if we're missing a
> dependency somewhere, though the package depends on suru-icon-theme already.
it may be this bug: https:/
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal | # |
Don't happrove this yet. I am abusing this MR to test whether the fix in the iconFix branch works.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1167
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1168
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1169
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:1170
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Cris Dywan (kalikiana) : | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1171
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml' | |||
2 | --- modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml 2014-07-22 15:11:03 +0000 | |||
3 | +++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml 2014-07-30 12:14:09 +0000 | |||
4 | @@ -20,8 +20,8 @@ | |||
5 | 20 | AbstractButton { | 20 | AbstractButton { |
6 | 21 | id: button | 21 | id: button |
7 | 22 | 22 | ||
10 | 23 | property int iconWidth: units.gu(2) | 23 | property real iconWidth: units.gu(2) |
11 | 24 | property int iconHeight: iconWidth | 24 | property real iconHeight: iconWidth |
12 | 25 | 25 | ||
13 | 26 | width: visible ? units.gu(4) : 0 | 26 | width: visible ? units.gu(4) : 0 |
14 | 27 | height: parent ? parent.height : undefined | 27 | height: parent ? parent.height : undefined |
15 | 28 | 28 | ||
16 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml' | |||
17 | --- modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-28 10:38:00 +0000 | |||
18 | +++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-30 12:14:09 +0000 | |||
19 | @@ -134,7 +134,7 @@ | |||
20 | 134 | visible: styledItem.pageStack !== null && | 134 | visible: styledItem.pageStack !== null && |
21 | 135 | styledItem.pageStack !== undefined && | 135 | styledItem.pageStack !== undefined && |
22 | 136 | styledItem.pageStack.depth > 1 && | 136 | styledItem.pageStack.depth > 1 && |
24 | 137 | !customBackButton.visible | 137 | !styledItem.config.backAction |
25 | 138 | 138 | ||
26 | 139 | text: "back" | 139 | text: "back" |
27 | 140 | 140 | ||
28 | 141 | 141 | ||
29 | === added file 'tests/unit_x11/tst_components/tst_headActions.qml' | |||
30 | --- tests/unit_x11/tst_components/tst_headActions.qml 1970-01-01 00:00:00 +0000 | |||
31 | +++ tests/unit_x11/tst_components/tst_headActions.qml 2014-07-30 12:14:09 +0000 | |||
32 | @@ -0,0 +1,103 @@ | |||
33 | 1 | /* | ||
34 | 2 | * Copyright 2014 Canonical Ltd. | ||
35 | 3 | * | ||
36 | 4 | * This program is free software; you can redistribute it and/or modify | ||
37 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
38 | 6 | * the Free Software Foundation; version 3. | ||
39 | 7 | * | ||
40 | 8 | * This program is distributed in the hope that it will be useful, | ||
41 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
42 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
43 | 11 | * GNU Lesser General Public License for more details. | ||
44 | 12 | * | ||
45 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
46 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
47 | 15 | */ | ||
48 | 16 | |||
49 | 17 | import QtQuick 2.2 | ||
50 | 18 | import Ubuntu.Test 1.0 | ||
51 | 19 | import Ubuntu.Components 1.1 | ||
52 | 20 | |||
53 | 21 | // NOTE: Other parts of the page head API are tested with autopilot in | ||
54 | 22 | // ubuntuuitoolkit.tests.components.test_header | ||
55 | 23 | |||
56 | 24 | Item { | ||
57 | 25 | width: units.gu(50) | ||
58 | 26 | height: units.gu(80) | ||
59 | 27 | |||
60 | 28 | MainView { | ||
61 | 29 | id: mainView | ||
62 | 30 | anchors.fill: parent | ||
63 | 31 | useDeprecatedToolbar: false | ||
64 | 32 | |||
65 | 33 | PageStack { | ||
66 | 34 | id: pageStack | ||
67 | 35 | Page { | ||
68 | 36 | id: page1 | ||
69 | 37 | title: "First page" | ||
70 | 38 | } | ||
71 | 39 | Page { | ||
72 | 40 | id: page2 | ||
73 | 41 | title: "Second page" | ||
74 | 42 | |||
75 | 43 | Action { | ||
76 | 44 | id: customBackAction | ||
77 | 45 | iconName: "search" | ||
78 | 46 | text: "Search" | ||
79 | 47 | } | ||
80 | 48 | Action { | ||
81 | 49 | id: invisibleAction | ||
82 | 50 | visible: false | ||
83 | 51 | } | ||
84 | 52 | } | ||
85 | 53 | } | ||
86 | 54 | Component.onCompleted: { | ||
87 | 55 | pageStack.push(page1); | ||
88 | 56 | } | ||
89 | 57 | } | ||
90 | 58 | |||
91 | 59 | UbuntuTestCase { | ||
92 | 60 | name: "HeaderBackButton" | ||
93 | 61 | when: windowShown | ||
94 | 62 | id: testCase | ||
95 | 63 | |||
96 | 64 | property var app_header | ||
97 | 65 | property var back_button | ||
98 | 66 | property var custom_back_button | ||
99 | 67 | |||
100 | 68 | function initTestCase() { | ||
101 | 69 | testCase.app_header = findChild(mainView, "MainView_Header"); | ||
102 | 70 | testCase.back_button = findChild(app_header, "backButton"); | ||
103 | 71 | testCase.custom_back_button = findChild(app_header, "customBackButton"); | ||
104 | 72 | |||
105 | 73 | compare(page2.head.backAction, null, "Back action set by default."); | ||
106 | 74 | compare(back_button.visible, false, "Back button visible with only 1 page on the stack."); | ||
107 | 75 | compare(custom_back_button.visible, false, "Custom back button visible without custom back action.") | ||
108 | 76 | } | ||
109 | 77 | |||
110 | 78 | function test_default_back_button() { | ||
111 | 79 | pageStack.push(page2); | ||
112 | 80 | compare(back_button.visible, true, "Back button not visible with 2 pages on stack."); | ||
113 | 81 | compare(custom_back_button.visible, false, "Showing custom back button without custom back action."); | ||
114 | 82 | pageStack.pop(); | ||
115 | 83 | } | ||
116 | 84 | |||
117 | 85 | function test_custom_back_button() { | ||
118 | 86 | page2.head.backAction = customBackAction; | ||
119 | 87 | pageStack.push(page2); | ||
120 | 88 | compare(back_button.visible, false, "Default back button visible with custom back action."); | ||
121 | 89 | compare(custom_back_button.visible, true, "Custom back button invisible with back action."); | ||
122 | 90 | pageStack.pop(); | ||
123 | 91 | page2.head.backAction = null; | ||
124 | 92 | } | ||
125 | 93 | |||
126 | 94 | function test_no_back_button() { | ||
127 | 95 | page2.head.backAction = invisibleAction; | ||
128 | 96 | pageStack.push(page2); | ||
129 | 97 | compare(back_button.visible, false, "Default back button visible with invisible custom back action."); | ||
130 | 98 | compare(custom_back_button.visible, false, "Custom back button visible with invisible custom back action."); | ||
131 | 99 | pageStack.pop(); | ||
132 | 100 | page2.head.backAction = null; | ||
133 | 101 | } | ||
134 | 102 | } | ||
135 | 103 | } |
why don't you put this
99 + pageStack.pop();
and this
117 + page2.head. backAction = null;
on the cleanup function?
I'm trying to learn more QML, so I'll put my nose on some of your new branches. Please bare with my questions while I get up to speed.