Merge lp:~unity-team/unity8/uitkPageHeader into lp:unity8
- uitkPageHeader
- Merge into trunk
Proposed by
Michael Terry
Status: | Merged |
---|---|
Approved by: | Michael Terry |
Approved revision: | 2331 |
Merged at revision: | 2425 |
Proposed branch: | lp:~unity-team/unity8/uitkPageHeader |
Merge into: | lp:unity8 |
Prerequisite: | lp:~mzanetti/unity8/reenable-skipped-tests |
Diff against target: |
510 lines (+120/-124) 9 files modified
qml/Components/Header.qml (+0/-28) qml/Dash/DashPageHeader.qml (+32/-37) qml/Dash/GenericScopeView.qml (+5/-0) qml/Stages/Splash.qml (+6/-17) tests/qmltests/Dash/tst_Dash.qml (+8/-8) tests/qmltests/Dash/tst_DashContent.qml (+64/-5) tests/qmltests/Dash/tst_DashPageHeader.qml (+0/-24) tests/qmltests/Dash/tst_GenericScopeView.qml (+2/-2) tests/qmltests/Dash/tst_PreviewView.qml (+3/-3) |
To merge this branch: | bzr merge lp:~unity-team/unity8/uitkPageHeader |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Cimitan (community) | Approve | ||
Review via email: mp+294967@code.launchpad.net |
Commit message
Use PageHeader instead Ambiance's PageHeadStyle
Description of the change
This is a carry-over from https:/
I just needed to rebase it to avoid conflicts. Will carry its approval over as well.
To post a comment you must log in.
- 2332. By Michael Terry
-
Fix splash header color
- 2333. By Michael Terry
-
And specify dividerColor
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed file 'qml/Components/Header.qml' | |||
2 | --- qml/Components/Header.qml 2016-01-25 10:12:48 +0000 | |||
3 | +++ qml/Components/Header.qml 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,28 +0,0 @@ | |||
5 | 1 | /* | ||
6 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
7 | 3 | * | ||
8 | 4 | * This program is free software; you can redistribute it and/or modify | ||
9 | 5 | * it under the terms of the GNU General Public License as published by | ||
10 | 6 | * the Free Software Foundation; version 3. | ||
11 | 7 | * | ||
12 | 8 | * This program is distributed in the hope that it will be useful, | ||
13 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | 11 | * GNU General Public License for more details. | ||
16 | 12 | * | ||
17 | 13 | * You should have received a copy of the GNU General Public License | ||
18 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | 15 | */ | ||
20 | 16 | |||
21 | 17 | import Ubuntu.Components 1.3 | ||
22 | 18 | import Ubuntu.Components.Themes.Ambiance 1.3 | ||
23 | 19 | |||
24 | 20 | PageHeadStyle { | ||
25 | 21 | // FIXME: Don't use this but PageHeader from Ubuntu.Components 1.3. | ||
26 | 22 | id: root | ||
27 | 23 | |||
28 | 24 | property var styledItem: root | ||
29 | 25 | property string title | ||
30 | 26 | property var config: PageHeadConfiguration {} | ||
31 | 27 | property var contents: null | ||
32 | 28 | } | ||
33 | 29 | 0 | ||
34 | === modified file 'qml/Dash/DashPageHeader.qml' | |||
35 | --- qml/Dash/DashPageHeader.qml 2016-04-27 15:01:10 +0000 | |||
36 | +++ qml/Dash/DashPageHeader.qml 2016-05-19 15:22:50 +0000 | |||
37 | @@ -16,7 +16,7 @@ | |||
38 | 16 | 16 | ||
39 | 17 | import QtQuick 2.4 | 17 | import QtQuick 2.4 |
40 | 18 | import Ubuntu.Components 1.3 | 18 | import Ubuntu.Components 1.3 |
42 | 19 | import Ubuntu.Components.Themes.Ambiance 1.3 | 19 | import Ubuntu.Components.Popups 1.3 |
43 | 20 | import Ubuntu.Components.ListItems 1.3 | 20 | import Ubuntu.Components.ListItems 1.3 |
44 | 21 | import "../Components" | 21 | import "../Components" |
45 | 22 | 22 | ||
46 | @@ -78,13 +78,13 @@ | |||
47 | 78 | } | 78 | } |
48 | 79 | } | 79 | } |
49 | 80 | 80 | ||
51 | 81 | function closePopup(keepFocus) { | 81 | function closePopup(keepFocus, keepSearch) { |
52 | 82 | if (extraPanel.visible) { | 82 | if (extraPanel.visible) { |
53 | 83 | extraPanel.visible = false; | 83 | extraPanel.visible = false; |
54 | 84 | } else if (!keepFocus) { | 84 | } else if (!keepFocus) { |
56 | 85 | unfocus(); | 85 | unfocus(keepSearch); |
57 | 86 | } | 86 | } |
59 | 87 | if (!searchTextField.text && !root.navigationTag && searchHistory.count == 0) { | 87 | if (!keepSearch && !searchTextField.text && !root.navigationTag && searchHistory.count == 0) { |
60 | 88 | headerContainer.showSearch = false; | 88 | headerContainer.showSearch = false; |
61 | 89 | } | 89 | } |
62 | 90 | } | 90 | } |
63 | @@ -97,9 +97,9 @@ | |||
64 | 97 | closePopup(keepFocus); | 97 | closePopup(keepFocus); |
65 | 98 | } | 98 | } |
66 | 99 | 99 | ||
68 | 100 | function unfocus() { | 100 | function unfocus(keepSearch) { |
69 | 101 | searchTextField.focus = false; | 101 | searchTextField.focus = false; |
71 | 102 | if (!searchTextField.text && !root.navigationTag) { | 102 | if (!keepSearch && !searchTextField.text && !root.navigationTag) { |
72 | 103 | headerContainer.showSearch = false; | 103 | headerContainer.showSearch = false; |
73 | 104 | } | 104 | } |
74 | 105 | } | 105 | } |
75 | @@ -142,7 +142,7 @@ | |||
76 | 142 | objectName: "headerContainer" | 142 | objectName: "headerContainer" |
77 | 143 | clip: contentY < height | 143 | clip: contentY < height |
78 | 144 | anchors { left: parent.left; top: parent.top; right: parent.right } | 144 | anchors { left: parent.left; top: parent.top; right: parent.right } |
80 | 145 | height: header.contentHeight | 145 | height: header.__styleInstance.contentHeight |
81 | 146 | contentHeight: headersColumn.height | 146 | contentHeight: headersColumn.height |
82 | 147 | interactive: false | 147 | interactive: false |
83 | 148 | contentY: showSearch ? 0 : height | 148 | contentY: showSearch ? 0 : height |
84 | @@ -173,22 +173,18 @@ | |||
85 | 173 | id: headersColumn | 173 | id: headersColumn |
86 | 174 | anchors { left: parent.left; right: parent.right } | 174 | anchors { left: parent.left; right: parent.right } |
87 | 175 | 175 | ||
90 | 176 | PageHeadStyle { | 176 | PageHeader { |
89 | 177 | // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3. | ||
91 | 178 | id: searchHeader | 177 | id: searchHeader |
92 | 179 | anchors { left: parent.left; right: parent.right } | 178 | anchors { left: parent.left; right: parent.right } |
93 | 180 | opacity: headerContainer.clip || headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout | 179 | opacity: headerContainer.clip || headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout |
102 | 181 | __separator_visible: false | 180 | |
103 | 182 | // Required to keep PageHeadStyle noise down as it expects the Page's properties around. | 181 | StyleHints { |
96 | 183 | property var styledItem: searchHeader | ||
97 | 184 | property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections | ||
98 | 185 | property color panelColor: background.topColor | ||
99 | 186 | panelForegroundColor: config.foregroundColor | ||
100 | 187 | backgroundColor: "transparent" | ||
101 | 188 | config: PageHeadConfiguration { | ||
104 | 189 | foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText | 182 | foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText |
105 | 183 | backgroundColor: "transparent" | ||
106 | 184 | dividerColor: "transparent" | ||
107 | 190 | } | 185 | } |
109 | 191 | property var contents: Item { | 186 | |
110 | 187 | contents: Item { | ||
111 | 192 | anchors.fill: parent | 188 | anchors.fill: parent |
112 | 193 | 189 | ||
113 | 194 | TextField { | 190 | TextField { |
114 | @@ -273,7 +269,7 @@ | |||
115 | 273 | anchors.fill: parent | 269 | anchors.fill: parent |
116 | 274 | anchors.margins: units.gu(2) | 270 | anchors.margins: units.gu(2) |
117 | 275 | name: "filters" | 271 | name: "filters" |
119 | 276 | color: root.activeFiltersCount > 0 ? UbuntuColors.orange : header.config.foregroundColor | 272 | color: root.activeFiltersCount > 0 ? UbuntuColors.orange : header.__styleInstance.foregroundColor |
120 | 277 | } | 273 | } |
121 | 278 | 274 | ||
122 | 279 | onClicked: { | 275 | onClicked: { |
123 | @@ -283,6 +279,7 @@ | |||
124 | 283 | 279 | ||
125 | 284 | AbstractButton { | 280 | AbstractButton { |
126 | 285 | id: cancelButton | 281 | id: cancelButton |
127 | 282 | objectName: "cancelButton" | ||
128 | 286 | width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin | 283 | width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin |
129 | 287 | anchors { | 284 | anchors { |
130 | 288 | top: parent.top | 285 | top: parent.top |
131 | @@ -296,7 +293,7 @@ | |||
132 | 296 | Label { | 293 | Label { |
133 | 297 | id: cancelLabel | 294 | id: cancelLabel |
134 | 298 | text: i18n.tr("Cancel") | 295 | text: i18n.tr("Cancel") |
136 | 299 | color: header.panelForegroundColor | 296 | color: header.__styleInstance.foregroundColor |
137 | 300 | verticalAlignment: Text.AlignVCenter | 297 | verticalAlignment: Text.AlignVCenter |
138 | 301 | anchors { | 298 | anchors { |
139 | 302 | verticalCenter: parent.verticalCenter | 299 | verticalCenter: parent.verticalCenter |
140 | @@ -309,28 +306,27 @@ | |||
141 | 309 | } | 306 | } |
142 | 310 | } | 307 | } |
143 | 311 | 308 | ||
146 | 312 | PageHeadStyle { | 309 | PageHeader { |
145 | 313 | // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3. | ||
147 | 314 | id: header | 310 | id: header |
148 | 315 | objectName: "innerPageHeader" | 311 | objectName: "innerPageHeader" |
149 | 316 | anchors { left: parent.left; right: parent.right } | 312 | anchors { left: parent.left; right: parent.right } |
150 | 317 | height: headerContainer.height | 313 | height: headerContainer.height |
151 | 318 | opacity: headerContainer.clip || !headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout | 314 | opacity: headerContainer.clip || !headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout |
160 | 319 | __separator_visible: false | 315 | title: root.title |
161 | 320 | property var styledItem: header | 316 | |
162 | 321 | property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections | 317 | StyleHints { |
155 | 322 | property color panelColor: background.topColor | ||
156 | 323 | panelForegroundColor: config.foregroundColor | ||
157 | 324 | backgroundColor: "transparent" | ||
158 | 325 | config: PageHeadConfiguration { | ||
159 | 326 | title: root.title | ||
163 | 327 | foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText | 318 | foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText |
170 | 328 | backAction: Action { | 319 | backgroundColor: "transparent" |
171 | 329 | iconName: backIsClose ? "close" : "back" | 320 | dividerColor: "transparent" |
172 | 330 | visible: root.showBackButton | 321 | } |
173 | 331 | onTriggered: root.backClicked() | 322 | |
174 | 332 | } | 323 | leadingActionBar.actions: Action { |
175 | 333 | 324 | iconName: backIsClose ? "close" : "back" | |
176 | 325 | visible: root.showBackButton | ||
177 | 326 | onTriggered: root.backClicked() | ||
178 | 327 | } | ||
179 | 328 | |||
180 | 329 | trailingActionBar { | ||
181 | 334 | actions: [ | 330 | actions: [ |
182 | 335 | Action { | 331 | Action { |
183 | 336 | objectName: "store" | 332 | objectName: "store" |
184 | @@ -366,7 +362,6 @@ | |||
185 | 366 | ] | 362 | ] |
186 | 367 | } | 363 | } |
187 | 368 | 364 | ||
188 | 369 | property var contents: null | ||
189 | 370 | Component.onCompleted: root.refreshLogo() | 365 | Component.onCompleted: root.refreshLogo() |
190 | 371 | 366 | ||
191 | 372 | Component { | 367 | Component { |
192 | 373 | 368 | ||
193 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
194 | --- qml/Dash/GenericScopeView.qml 2016-05-04 18:08:35 +0000 | |||
195 | +++ qml/Dash/GenericScopeView.qml 2016-05-19 15:22:50 +0000 | |||
196 | @@ -662,6 +662,10 @@ | |||
197 | 662 | onShowFiltersPopup: { // item | 662 | onShowFiltersPopup: { // item |
198 | 663 | extraPanel.visible = false; | 663 | extraPanel.visible = false; |
199 | 664 | scopeView.filtersPopover = PopupUtils.open(Qt.resolvedUrl("FiltersPopover.qml"), item, { "contentWidth": scopeView.width - units.gu(2) } ); | 664 | scopeView.filtersPopover = PopupUtils.open(Qt.resolvedUrl("FiltersPopover.qml"), item, { "contentWidth": scopeView.width - units.gu(2) } ); |
200 | 665 | scopeView.filtersPopover.Component.onDestruction.connect(function () { | ||
201 | 666 | categoryView.pageHeader.closePopup(false, true); | ||
202 | 667 | categoryView.pageHeader.unfocus(true); // remove the focus from the search field | ||
203 | 668 | }) | ||
204 | 665 | } | 669 | } |
205 | 666 | } | 670 | } |
206 | 667 | 671 | ||
207 | @@ -683,6 +687,7 @@ | |||
208 | 683 | onHistoryItemClicked: { | 687 | onHistoryItemClicked: { |
209 | 684 | SearchHistoryModel.addQuery(text); | 688 | SearchHistoryModel.addQuery(text); |
210 | 685 | categoryView.pageHeader.searchQuery = text; | 689 | categoryView.pageHeader.searchQuery = text; |
211 | 690 | categoryView.pageHeader.unfocus(); | ||
212 | 686 | } | 691 | } |
213 | 687 | 692 | ||
214 | 688 | onDashNavigationLeafClicked: { | 693 | onDashNavigationLeafClicked: { |
215 | 689 | 694 | ||
216 | === modified file 'qml/Stages/Splash.qml' | |||
217 | --- qml/Stages/Splash.qml 2016-03-08 20:59:22 +0000 | |||
218 | +++ qml/Stages/Splash.qml 2016-05-19 15:22:50 +0000 | |||
219 | @@ -29,7 +29,7 @@ | |||
220 | 29 | property color footerColor: d.undefinedColor | 29 | property color footerColor: d.undefinedColor |
221 | 30 | property alias imageSource: overlaidImage.source | 30 | property alias imageSource: overlaidImage.source |
222 | 31 | property url icon | 31 | property url icon |
224 | 32 | property alias title: headerConfig.title | 32 | property alias title: header.title |
225 | 33 | property alias showHeader: header.visible | 33 | property alias showHeader: header.visible |
226 | 34 | 34 | ||
227 | 35 | Ambiance.Palette { | 35 | Ambiance.Palette { |
228 | @@ -75,25 +75,14 @@ | |||
229 | 75 | style: Component { MainViewStyle {theme: styledItem.fakeTheme} } | 75 | style: Component { MainViewStyle {theme: styledItem.fakeTheme} } |
230 | 76 | } | 76 | } |
231 | 77 | 77 | ||
234 | 78 | Ambiance.PageHeadStyle { | 78 | PageHeader { |
233 | 79 | // FIXME: Replace PageHeadStyle by PageHeader from Ubuntu.Components 1.3. | ||
235 | 80 | id: header | 79 | id: header |
248 | 81 | anchors { | 80 | anchors { left: parent.left; right: parent.right } |
249 | 82 | left: parent.left; | 81 | StyleHints { |
238 | 83 | right: parent.right | ||
239 | 84 | } | ||
240 | 85 | property var styledItem: header | ||
241 | 86 | // FIXME Keep in sync with SDK's MainView.qml values of these two colors | ||
242 | 87 | property color dividerColor: Qt.darker(styledItem.backgroundColor, 1.1) | ||
243 | 88 | property color panelColor: Qt.lighter(styledItem.backgroundColor, 1.1) | ||
244 | 89 | panelForegroundColor: config.foregroundColor | ||
245 | 90 | backgroundColor: "transparent" | ||
246 | 91 | config: PageHeadConfiguration { | ||
247 | 92 | id: headerConfig | ||
250 | 93 | foregroundColor: styledItem.fakeTheme.palette.normal.backgroundText | 82 | foregroundColor: styledItem.fakeTheme.palette.normal.backgroundText |
251 | 83 | backgroundColor: "transparent" | ||
252 | 84 | dividerColor: styledItem.fakeTheme.palette.normal.base | ||
253 | 94 | } | 85 | } |
254 | 95 | |||
255 | 96 | property var contents: null | ||
256 | 97 | } | 86 | } |
257 | 98 | 87 | ||
258 | 99 | Image { | 88 | Image { |
259 | 100 | 89 | ||
260 | === modified file 'tests/qmltests/Dash/tst_Dash.qml' | |||
261 | --- tests/qmltests/Dash/tst_Dash.qml 2016-05-19 15:22:49 +0000 | |||
262 | +++ tests/qmltests/Dash/tst_Dash.qml 2016-05-19 15:22:50 +0000 | |||
263 | @@ -125,7 +125,7 @@ | |||
264 | 125 | // Go back | 125 | // Go back |
265 | 126 | var scopesList = findChild(dash, "scopesList"); | 126 | var scopesList = findChild(dash, "scopesList"); |
266 | 127 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); | 127 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); |
268 | 128 | var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton"); | 128 | var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar; |
269 | 129 | mouseClick(backButton); | 129 | mouseClick(backButton); |
270 | 130 | tryCompare(bottomEdgeController, "progress", 0); | 130 | tryCompare(bottomEdgeController, "progress", 0); |
271 | 131 | } | 131 | } |
272 | @@ -200,7 +200,7 @@ | |||
273 | 200 | 200 | ||
274 | 201 | // Go back | 201 | // Go back |
275 | 202 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); | 202 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); |
277 | 203 | var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton"); | 203 | var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar; |
278 | 204 | mouseClick(backButton); | 204 | mouseClick(backButton); |
279 | 205 | 205 | ||
280 | 206 | // Check temp scope is gone | 206 | // Check temp scope is gone |
281 | @@ -226,7 +226,7 @@ | |||
282 | 226 | // Go back | 226 | // Go back |
283 | 227 | var scopesList = findChild(dash, "scopesList"); | 227 | var scopesList = findChild(dash, "scopesList"); |
284 | 228 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); | 228 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); |
286 | 229 | var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton"); | 229 | var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar; |
287 | 230 | mouseClick(backButton); | 230 | mouseClick(backButton); |
288 | 231 | tryCompare(bottomEdgeController, "progress", 0); | 231 | tryCompare(bottomEdgeController, "progress", 0); |
289 | 232 | } | 232 | } |
290 | @@ -338,7 +338,7 @@ | |||
291 | 338 | // Exit edit mode and go back | 338 | // Exit edit mode and go back |
292 | 339 | var scopesList = findChild(dash, "scopesList"); | 339 | var scopesList = findChild(dash, "scopesList"); |
293 | 340 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); | 340 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); |
295 | 341 | var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton"); | 341 | var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar; |
296 | 342 | mouseClick(backButton); | 342 | mouseClick(backButton); |
297 | 343 | mouseClick(backButton); | 343 | mouseClick(backButton); |
298 | 344 | tryCompare(bottomEdgeController, "progress", 0); | 344 | tryCompare(bottomEdgeController, "progress", 0); |
299 | @@ -383,7 +383,7 @@ | |||
300 | 383 | // Exit edit mode | 383 | // Exit edit mode |
301 | 384 | var scopesList = findChild(dash, "scopesList"); | 384 | var scopesList = findChild(dash, "scopesList"); |
302 | 385 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); | 385 | var scopesListPageHeader = findChild(scopesList, "pageHeader"); |
304 | 386 | var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton"); | 386 | var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar; |
305 | 387 | mouseClick(backButton); | 387 | mouseClick(backButton); |
306 | 388 | 388 | ||
307 | 389 | // Click on third scope | 389 | // Click on third scope |
308 | @@ -493,7 +493,7 @@ | |||
309 | 493 | 493 | ||
310 | 494 | // Go back | 494 | // Go back |
311 | 495 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); | 495 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); |
313 | 496 | var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton"); | 496 | var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar; |
314 | 497 | mouseClick(backButton); | 497 | mouseClick(backButton); |
315 | 498 | 498 | ||
316 | 499 | // Check temp scope is gone | 499 | // Check temp scope is gone |
317 | @@ -561,7 +561,7 @@ | |||
318 | 561 | 561 | ||
319 | 562 | // Go back | 562 | // Go back |
320 | 563 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); | 563 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); |
322 | 564 | var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton"); | 564 | var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar; |
323 | 565 | mouseClick(backButton); | 565 | mouseClick(backButton); |
324 | 566 | 566 | ||
325 | 567 | // Check temp scope is gone | 567 | // Check temp scope is gone |
326 | @@ -593,7 +593,7 @@ | |||
327 | 593 | 593 | ||
328 | 594 | // Go back | 594 | // Go back |
329 | 595 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); | 595 | var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader"); |
331 | 596 | var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton"); | 596 | var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar; |
332 | 597 | mouseClick(backButton); | 597 | mouseClick(backButton); |
333 | 598 | 598 | ||
334 | 599 | // Check temp scope is gone | 599 | // Check temp scope is gone |
335 | 600 | 600 | ||
336 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' | |||
337 | --- tests/qmltests/Dash/tst_DashContent.qml 2016-03-29 03:47:39 +0000 | |||
338 | +++ tests/qmltests/Dash/tst_DashContent.qml 2016-05-19 15:22:50 +0000 | |||
339 | @@ -215,7 +215,7 @@ | |||
340 | 215 | verify(pageHeader, "Could not find the scope page header."); | 215 | verify(pageHeader, "Could not find the scope page header."); |
341 | 216 | var innerHeader = findChild(pageHeader, "innerPageHeader"); | 216 | var innerHeader = findChild(pageHeader, "innerPageHeader"); |
342 | 217 | verify(innerHeader, "Could not find the scope page header."); | 217 | verify(innerHeader, "Could not find the scope page header."); |
344 | 218 | compare(innerHeader.config.title, scopesModel.getScope(data.index).name); | 218 | compare(innerHeader.title, scopesModel.getScope(data.index).name); |
345 | 219 | } | 219 | } |
346 | 220 | 220 | ||
347 | 221 | function test_is_active_data() { | 221 | function test_is_active_data() { |
348 | @@ -515,10 +515,18 @@ | |||
349 | 515 | } | 515 | } |
350 | 516 | 516 | ||
351 | 517 | function test_navigationShowFilterPopup() { | 517 | function test_navigationShowFilterPopup() { |
352 | 518 | goToSecondLevel(); | ||
353 | 519 | |||
354 | 520 | var dashContentList = findChild(dashContent, "dashContentList"); | 518 | var dashContentList = findChild(dashContent, "dashContentList"); |
355 | 519 | var pageHeader = findChild(dashContentList.currentItem, "scopePageHeader") | ||
356 | 521 | var settingsButton = findChild(dashContentList.currentItem, "settingsButton"); | 520 | var settingsButton = findChild(dashContentList.currentItem, "settingsButton"); |
357 | 521 | var searchButton = findChild(dashContentList.currentItem, "search_button"); | ||
358 | 522 | var cancelButton = findChild(dashContentList.currentItem, "cancelButton"); | ||
359 | 523 | var searchTextField = findChild(pageHeader, "searchTextField"); | ||
360 | 524 | var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel"); | ||
361 | 525 | var headerContainer = findChild(pageHeader, "headerContainer"); | ||
362 | 526 | |||
363 | 527 | // test that closing the filters popover without a search unfocuses and removes the navigation | ||
364 | 528 | mouseClick(searchButton); | ||
365 | 529 | tryCompare(peExtraPanel, "visible", true); | ||
366 | 522 | 530 | ||
367 | 523 | var filtersPopover = findChild(shell, "filtersPopover") | 531 | var filtersPopover = findChild(shell, "filtersPopover") |
368 | 524 | verify(!filtersPopover); | 532 | verify(!filtersPopover); |
369 | @@ -526,8 +534,33 @@ | |||
370 | 526 | mouseClick(settingsButton); | 534 | mouseClick(settingsButton); |
371 | 527 | 535 | ||
372 | 528 | filtersPopover = findChild(shell, "filtersPopover") | 536 | filtersPopover = findChild(shell, "filtersPopover") |
375 | 529 | 537 | verify(filtersPopover); | |
376 | 530 | verify(filtersPopover); | 538 | |
377 | 539 | mouseClick(shell, shell.width - 1, shell.height - 1); | ||
378 | 540 | |||
379 | 541 | tryCompare(pageHeader.extraPanel, "visible", false); | ||
380 | 542 | tryCompare(headerContainer, "showSearch", true); | ||
381 | 543 | tryCompare(searchTextField, "focus", false); | ||
382 | 544 | |||
383 | 545 | mouseClick(cancelButton); | ||
384 | 546 | tryCompare(headerContainer, "showSearch", false); | ||
385 | 547 | tryCompare(headerContainer, "contentY", headerContainer.height); | ||
386 | 548 | |||
387 | 549 | // test within a navigation | ||
388 | 550 | goToSecondLevel(); | ||
389 | 551 | |||
390 | 552 | filtersPopover = findChild(shell, "filtersPopover") | ||
391 | 553 | verify(!filtersPopover); | ||
392 | 554 | |||
393 | 555 | mouseClick(settingsButton); | ||
394 | 556 | |||
395 | 557 | filtersPopover = findChild(shell, "filtersPopover") | ||
396 | 558 | verify(filtersPopover); | ||
397 | 559 | |||
398 | 560 | mouseClick(shell, shell.width - 1, shell.height - 1); | ||
399 | 561 | |||
400 | 562 | tryCompare(pageHeader.extraPanel, "visible", false); | ||
401 | 563 | tryCompare(headerContainer, "showSearch", true); | ||
402 | 531 | } | 564 | } |
403 | 532 | 565 | ||
404 | 533 | function test_primaryFilter() { | 566 | function test_primaryFilter() { |
405 | @@ -625,5 +658,31 @@ | |||
406 | 625 | tryCompareFunction(function() { return dashContentList.currentItem.item.scope.id == nextScopeId; }, true); | 658 | tryCompareFunction(function() { return dashContentList.currentItem.item.scope.id == nextScopeId; }, true); |
407 | 626 | compare(dashContentList.currentIndex, 0); | 659 | compare(dashContentList.currentIndex, 0); |
408 | 627 | } | 660 | } |
409 | 661 | |||
410 | 662 | function test_extraPanel() { | ||
411 | 663 | var dashContentList = findChild(dashContent, "dashContentList"); | ||
412 | 664 | var pageHeader = findChild(dashContentList.currentItem, "scopePageHeader") | ||
413 | 665 | pageHeader.searchEntryEnabled = true; | ||
414 | 666 | pageHeader.searchHistory.clear(); | ||
415 | 667 | |||
416 | 668 | pageHeader.searchHistory.addQuery("Search1"); | ||
417 | 669 | pageHeader.searchHistory.addQuery("Search2"); | ||
418 | 670 | |||
419 | 671 | pageHeader.triggerSearch(); | ||
420 | 672 | tryCompare(pageHeader.extraPanel, "visible", true); | ||
421 | 673 | |||
422 | 674 | var searchTextField = findChild(pageHeader, "searchTextField"); | ||
423 | 675 | compare(searchTextField.focus, true); | ||
424 | 676 | |||
425 | 677 | var recentSearches = findChild(pageHeader.extraPanel, "recentSearchesRepeater"); | ||
426 | 678 | verify(recentSearches, "Could not find recent searches"); | ||
427 | 679 | |||
428 | 680 | waitForRendering(recentSearches); | ||
429 | 681 | |||
430 | 682 | mouseClick(recentSearches.itemAt(0)); | ||
431 | 683 | compare(pageHeader.searchQuery, "Search2"); | ||
432 | 684 | tryCompare(pageHeader.extraPanel, "visible", false); | ||
433 | 685 | compare(searchTextField.focus, false); | ||
434 | 686 | } | ||
435 | 628 | } | 687 | } |
436 | 629 | } | 688 | } |
437 | 630 | 689 | ||
438 | === modified file 'tests/qmltests/Dash/tst_DashPageHeader.qml' | |||
439 | --- tests/qmltests/Dash/tst_DashPageHeader.qml 2016-03-29 03:47:39 +0000 | |||
440 | +++ tests/qmltests/Dash/tst_DashPageHeader.qml 2016-05-19 15:22:50 +0000 | |||
441 | @@ -147,30 +147,6 @@ | |||
442 | 147 | doResetSearch(); | 147 | doResetSearch(); |
443 | 148 | } | 148 | } |
444 | 149 | 149 | ||
445 | 150 | function test_extraPanel() { | ||
446 | 151 | searchEnabled = true; | ||
447 | 152 | pageHeader.searchHistory.clear(); | ||
448 | 153 | |||
449 | 154 | pageHeader.searchHistory.addQuery("Search1"); | ||
450 | 155 | pageHeader.searchHistory.addQuery("Search2"); | ||
451 | 156 | |||
452 | 157 | pageHeader.triggerSearch(); | ||
453 | 158 | |||
454 | 159 | tryCompare(pageHeader.extraPanel, "visible", true); | ||
455 | 160 | |||
456 | 161 | var searchTextField = findChild(pageHeader, "searchTextField"); | ||
457 | 162 | compare(searchTextField.focus, true); | ||
458 | 163 | |||
459 | 164 | var recentSearches = findChild(pageHeader.extraPanel, "recentSearchesRepeater"); | ||
460 | 165 | verify(recentSearches, "Could not find recent searches"); | ||
461 | 166 | waitForRendering(recentSearches); | ||
462 | 167 | mouseClick(recentSearches.itemAt(0)); | ||
463 | 168 | |||
464 | 169 | compare(pageHeader.searchQuery, "Search2"); | ||
465 | 170 | tryCompare(pageHeader.extraPanel, "visible", false); | ||
466 | 171 | compare(searchTextField.focus, false); | ||
467 | 172 | } | ||
468 | 173 | |||
469 | 174 | function test_popup_closing_data() { | 150 | function test_popup_closing_data() { |
470 | 175 | return [ | 151 | return [ |
471 | 176 | { tag: "with search text", searchText: "foobar", hideSearch: false }, | 152 | { tag: "with search text", searchText: "foobar", hideSearch: false }, |
472 | 177 | 153 | ||
473 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' | |||
474 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2016-03-29 03:47:39 +0000 | |||
475 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2016-05-19 15:22:50 +0000 | |||
476 | @@ -442,8 +442,8 @@ | |||
477 | 442 | 442 | ||
478 | 443 | var innerHeader = findChild(header, "innerPageHeader"); | 443 | var innerHeader = findChild(header, "innerPageHeader"); |
479 | 444 | verify(innerHeader, "Could not find the inner header"); | 444 | verify(innerHeader, "Could not find the inner header"); |
482 | 445 | verify(Qt.colorEqual(innerHeader.config.foregroundColor, data.foreground), | 445 | verify(Qt.colorEqual(innerHeader.__styleInstance.foregroundColor, data.foreground), |
483 | 446 | "Foreground color not equal: %1 != %2".arg(innerHeader.config.foregroundColor).arg(data.foreground)); | 446 | "Foreground color not equal: %1 != %2".arg(innerHeader.__styleInstance.foregroundColor).arg(data.foreground)); |
484 | 447 | 447 | ||
485 | 448 | var background = findChild(header, "headerBackground"); | 448 | var background = findChild(header, "headerBackground"); |
486 | 449 | verify(background, "Could not find the background"); | 449 | verify(background, "Could not find the background"); |
487 | 450 | 450 | ||
488 | === modified file 'tests/qmltests/Dash/tst_PreviewView.qml' | |||
489 | --- tests/qmltests/Dash/tst_PreviewView.qml 2016-03-29 03:47:39 +0000 | |||
490 | +++ tests/qmltests/Dash/tst_PreviewView.qml 2016-05-19 15:22:50 +0000 | |||
491 | @@ -98,7 +98,7 @@ | |||
492 | 98 | var header = findChild(view, "innerPageHeader"); | 98 | var header = findChild(view, "innerPageHeader"); |
493 | 99 | verify(header, "Could not find the preview header"); | 99 | verify(header, "Could not find the preview header"); |
494 | 100 | 100 | ||
496 | 101 | compare(header.config.title, "Mock Scope"); | 101 | compare(header.title, "Mock Scope"); |
497 | 102 | } | 102 | } |
498 | 103 | 103 | ||
499 | 104 | function test_header_style() { | 104 | function test_header_style() { |
500 | @@ -107,8 +107,8 @@ | |||
501 | 107 | 107 | ||
502 | 108 | var innerHeader = findChild(header, "innerPageHeader"); | 108 | var innerHeader = findChild(header, "innerPageHeader"); |
503 | 109 | verify(innerHeader, "Could not find the inner header"); | 109 | verify(innerHeader, "Could not find the inner header"); |
506 | 110 | verify(Qt.colorEqual(innerHeader.config.foregroundColor, UbuntuColors.darkGrey), | 110 | verify(Qt.colorEqual(innerHeader.__styleInstance.foregroundColor, UbuntuColors.darkGrey), |
507 | 111 | "Foreground color not equal: %1 != %2".arg(innerHeader.config.foregroundColor).arg(UbuntuColors.darkGrey)); | 111 | "Foreground color not equal: %1 != %2".arg(innerHeader.__styleInstance.foregroundColor).arg(UbuntuColors.darkGrey)); |
508 | 112 | 112 | ||
509 | 113 | var background = findChild(header, "headerBackground"); | 113 | var background = findChild(header, "headerBackground"); |
510 | 114 | verify(background, "Could not find the background"); | 114 | verify(background, "Could not find the background"); |
thank you