Merge lp:~unity-team/unity8/low_crome_mode into lp:unity8
- low_crome_mode
- Merge into trunk
Proposed by
Nick Dedekind
Status: | Work in progress |
---|---|
Proposed branch: | lp:~unity-team/unity8/low_crome_mode |
Merge into: | lp:unity8 |
Diff against target: |
741 lines (+125/-71) 19 files modified
qml/Panel/Panel.qml (+8/-8) qml/Shell.qml (+5/-5) qml/Stages/AbstractStage.qml (+1/-0) qml/Stages/ApplicationWindow.qml (+0/-1) qml/Stages/DecoratedWindow.qml (+5/-6) qml/Stages/DesktopStage.qml (+6/-3) qml/Stages/PhoneStage.qml (+2/-0) qml/Stages/SpreadDelegate.qml (+2/-1) qml/Stages/TabletStage.qml (+2/-0) qml/Stages/TransformedTabletSpreadDelegate.qml (+1/-1) qml/Tutorial/TutorialRight.qml (+4/-0) tests/mocks/Unity/Application/ApplicationInfo.cpp (+10/-0) tests/mocks/Unity/Application/ApplicationInfo.h (+6/-0) tests/mocks/Unity/Application/ApplicationManager.cpp (+8/-5) tests/mocks/Unity/Application/ApplicationManager.h (+1/-0) tests/mocks/Unity/Application/Session.cpp (+5/-2) tests/qmltests/Panel/tst_Panel.qml (+26/-26) tests/qmltests/tst_Shell.qml (+31/-11) tests/qmltests/tst_ShellWithPin.qml (+2/-2) |
To merge this branch: | bzr merge lp:~unity-team/unity8/low_crome_mode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity Team | Pending | ||
Review via email: mp+283828@code.launchpad.net |
Commit message
Separate fullscreen and low crome modes
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
To post a comment you must log in.
- 2143. By Nick Dedekind
-
fixes
Unmerged revisions
- 2143. By Nick Dedekind
-
fixes
- 2142. By Nick Dedekind
-
hideDecorations
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'qml/Panel/Panel.qml' |
2 | --- qml/Panel/Panel.qml 2015-11-25 13:57:34 +0000 |
3 | +++ qml/Panel/Panel.qml 2016-01-26 14:16:15 +0000 |
4 | @@ -26,7 +26,7 @@ |
5 | readonly property real panelHeight: indicatorArea.y + d.indicatorHeight |
6 | property alias indicators: __indicators |
7 | property alias callHint: __callHint |
8 | - property bool fullscreenMode: false |
9 | + property bool pinned: true |
10 | property real indicatorAreaShowProgress: 1.0 |
11 | property bool locked: false |
12 | |
13 | @@ -153,7 +153,7 @@ |
14 | } |
15 | return root.width |
16 | } |
17 | - enableHint: !callHint.active && !fullscreenMode |
18 | + enableHint: !callHint.active && !pinned |
19 | showOnClick: !callHint.visible |
20 | panelColor: indicatorAreaBackground.color |
21 | |
22 | @@ -204,8 +204,8 @@ |
23 | |
24 | states: [ |
25 | State { |
26 | - name: "onscreen" //fully opaque and visible at top edge of screen |
27 | - when: !fullscreenMode |
28 | + name: "pinned" //fully opaque and visible at top edge of screen |
29 | + when: pinned |
30 | PropertyChanges { |
31 | target: indicatorArea; |
32 | anchors.topMargin: 0 |
33 | @@ -213,8 +213,8 @@ |
34 | } |
35 | }, |
36 | State { |
37 | - name: "offscreen" //pushed off screen |
38 | - when: fullscreenMode |
39 | + name: "unpinned" //pushed off screen |
40 | + when: !pinned |
41 | PropertyChanges { |
42 | target: indicatorArea; |
43 | anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0 |
44 | @@ -229,11 +229,11 @@ |
45 | |
46 | transitions: [ |
47 | Transition { |
48 | - to: "onscreen" |
49 | + to: "pinned" |
50 | UbuntuNumberAnimation { target: indicatorArea; properties: "anchors.topMargin,opacity" } |
51 | }, |
52 | Transition { |
53 | - to: "offscreen" |
54 | + to: "unpinned" |
55 | UbuntuNumberAnimation { target: indicatorArea; properties: "anchors.topMargin,opacity" } |
56 | } |
57 | ] |
58 | |
59 | === modified file 'qml/Shell.qml' |
60 | --- qml/Shell.qml 2015-11-30 11:55:40 +0000 |
61 | +++ qml/Shell.qml 2016-01-26 14:16:15 +0000 |
62 | @@ -525,12 +525,12 @@ |
63 | greeterShown: greeter.shown |
64 | } |
65 | |
66 | - readonly property bool topmostApplicationIsFullscreen: |
67 | - ApplicationManager.focusedApplicationId && |
68 | - ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen |
69 | + readonly property bool mainAppIsFullscreen: { |
70 | + applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainAppIsFullscreen : false |
71 | + } |
72 | |
73 | - fullscreenMode: (topmostApplicationIsFullscreen && !lightDM.greeter.active && launcher.progress == 0) |
74 | - || greeter.hasLockedApp |
75 | + pinned: (!mainAppIsFullscreen || lightDM.greeter.active || launcher.progress !== 0) |
76 | + && !greeter.hasLockedApp |
77 | locked: greeter && greeter.active |
78 | } |
79 | |
80 | |
81 | === modified file 'qml/Stages/AbstractStage.qml' |
82 | --- qml/Stages/AbstractStage.qml 2015-10-27 21:29:56 +0000 |
83 | +++ qml/Stages/AbstractStage.qml 2016-01-26 14:16:15 +0000 |
84 | @@ -44,6 +44,7 @@ |
85 | property var mainApp: null |
86 | property int mainAppWindowOrientationAngle |
87 | property bool orientationChangesEnabled |
88 | + property bool mainAppIsFullscreen: mainApp ? mainApp.fullscreen : false |
89 | |
90 | // Shared code for use in stage implementations |
91 | GSettings { |
92 | |
93 | === modified file 'qml/Stages/ApplicationWindow.qml' |
94 | --- qml/Stages/ApplicationWindow.qml 2015-11-23 13:52:39 +0000 |
95 | +++ qml/Stages/ApplicationWindow.qml 2016-01-26 14:16:15 +0000 |
96 | @@ -24,7 +24,6 @@ |
97 | implicitHeight: sessionContainer.implicitHeight |
98 | |
99 | // to be read from outside |
100 | - readonly property bool fullscreen: application ? application.fullscreen : false |
101 | property alias interactive: sessionContainer.interactive |
102 | property bool orientationChangesEnabled: d.supportsSurfaceResize ? d.surfaceOldEnoughToBeResized : true |
103 | readonly property string title: sessionContainer.surface && sessionContainer.surface.name !== "" ? |
104 | |
105 | === modified file 'qml/Stages/DecoratedWindow.qml' |
106 | --- qml/Stages/DecoratedWindow.qml 2015-11-23 15:09:45 +0000 |
107 | +++ qml/Stages/DecoratedWindow.qml 2016-01-26 14:16:15 +0000 |
108 | @@ -24,15 +24,14 @@ |
109 | id: root |
110 | |
111 | width: applicationWindow.width |
112 | - height: (decorationShown ? decoration.height : 0) + applicationWindow.height |
113 | + height: (hideDecorations ? 0 : decoration.height) + applicationWindow.height |
114 | |
115 | property alias window: applicationWindow |
116 | property alias application: applicationWindow.application |
117 | property alias active: decoration.active |
118 | property alias title: decoration.title |
119 | - property alias fullscreen: applicationWindow.fullscreen |
120 | |
121 | - readonly property bool decorationShown: !fullscreen |
122 | + property bool hideDecorations: false |
123 | property bool highlightShown: false |
124 | property real shadowOpacity: 1 |
125 | |
126 | @@ -66,7 +65,7 @@ |
127 | } |
128 | source: "graphics/dropshadow2gu.sci" |
129 | opacity: root.shadowOpacity * .3 |
130 | - enabled: !fullscreen |
131 | + enabled: !root.hideDecorations |
132 | } |
133 | |
134 | WindowDecoration { |
135 | @@ -77,7 +76,7 @@ |
136 | height: units.gu(3) |
137 | width: root.width |
138 | title: window.title |
139 | - visible: root.decorationShown |
140 | + visible: !root.hideDecorations |
141 | |
142 | onClose: root.close(); |
143 | onMaximize: { root.decorationPressed(); root.maximize(); } |
144 | @@ -91,7 +90,7 @@ |
145 | anchors.top: parent.top |
146 | anchors.topMargin: decoration.height |
147 | anchors.left: parent.left |
148 | - requestedHeight: root.requestedHeight - (root.decorationShown ? decoration.height : 0) |
149 | + requestedHeight: root.requestedHeight - (root.hideDecorations ? 0 : decoration.height) |
150 | interactive: true |
151 | focus: true |
152 | } |
153 | |
154 | === modified file 'qml/Stages/DesktopStage.qml' |
155 | --- qml/Stages/DesktopStage.qml 2016-01-08 13:29:03 +0000 |
156 | +++ qml/Stages/DesktopStage.qml 2016-01-26 14:16:15 +0000 |
157 | @@ -264,6 +264,8 @@ |
158 | readonly property alias maximizedRight: appDelegatePrivate.maximizedRight |
159 | readonly property alias minimized: appDelegatePrivate.minimized |
160 | |
161 | + readonly property QtObject application: ApplicationManager.get(index) |
162 | + readonly property bool fullscreen: application && application.fullscreen |
163 | readonly property string appId: model.appId |
164 | property bool animationsEnabled: true |
165 | property alias title: decoratedWindow.title |
166 | @@ -285,7 +287,7 @@ |
167 | (spread.state == "altTab" && index === spread.highlightedIndex) |
168 | |
169 | Binding { |
170 | - target: ApplicationManager.get(index) |
171 | + target: appDelegate.application |
172 | property: "requestedState" |
173 | // TODO: figure out some lifecycle policy, like suspending minimized apps |
174 | // if running on a tablet or something. |
175 | @@ -339,7 +341,7 @@ |
176 | |
177 | states: [ |
178 | State { |
179 | - name: "fullscreen"; when: decoratedWindow.fullscreen |
180 | + name: "fullscreen"; when: appDelegate.fullscreen |
181 | extend: "maximized" |
182 | PropertyChanges { |
183 | target: appDelegate; |
184 | @@ -448,7 +450,8 @@ |
185 | objectName: "decoratedWindow" |
186 | anchors.left: appDelegate.left |
187 | anchors.top: appDelegate.top |
188 | - application: ApplicationManager.get(index) |
189 | + application: appDelegate.application |
190 | + hideDecorations: application ? application.fullscreen : false |
191 | active: ApplicationManager.focusedApplicationId === model.appId |
192 | focus: true |
193 | |
194 | |
195 | === modified file 'qml/Stages/PhoneStage.qml' |
196 | --- qml/Stages/PhoneStage.qml 2015-12-03 18:10:39 +0000 |
197 | +++ qml/Stages/PhoneStage.qml 2016-01-26 14:16:15 +0000 |
198 | @@ -77,6 +77,7 @@ |
199 | mainApp: applicationManager.focusedApplicationId |
200 | ? applicationManager.findApplication(applicationManager.focusedApplicationId) |
201 | : null |
202 | + mainAppIsFullscreen: mainApp ? (mainApp.hideDecorations !== mainApp.fullscreen) : false |
203 | |
204 | orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled |
205 | && !priv.focusedAppDelegateIsDislocated |
206 | @@ -460,6 +461,7 @@ |
207 | } |
208 | |
209 | application: root.applicationManager.get(index) |
210 | + fullscreen: application ? (mainApp.hideDecorations !== mainApp.fullscreen) : false |
211 | closeable: !isDash |
212 | |
213 | property real behavioredIndex: index |
214 | |
215 | === modified file 'qml/Stages/SpreadDelegate.qml' |
216 | --- qml/Stages/SpreadDelegate.qml 2015-11-04 14:57:45 +0000 |
217 | +++ qml/Stages/SpreadDelegate.qml 2016-01-26 14:16:15 +0000 |
218 | @@ -34,6 +34,7 @@ |
219 | readonly property alias orientationChangesEnabled: appWindow.orientationChangesEnabled |
220 | |
221 | // to be set from outside |
222 | + property bool fullscreen: false |
223 | property bool interactive: true |
224 | property bool dropShadow: true |
225 | property real maximizedAppTopMargin |
226 | @@ -267,7 +268,7 @@ |
227 | focus: true |
228 | anchors { |
229 | fill: parent |
230 | - topMargin: appWindow.fullscreen || (application && application.rotatesWindowContents) |
231 | + topMargin: root.fullscreen || (application && application.rotatesWindowContents) |
232 | ? 0 : maximizedAppTopMargin |
233 | } |
234 | |
235 | |
236 | === modified file 'qml/Stages/TabletStage.qml' |
237 | --- qml/Stages/TabletStage.qml 2015-12-03 18:10:39 +0000 |
238 | +++ qml/Stages/TabletStage.qml 2016-01-26 14:16:15 +0000 |
239 | @@ -71,6 +71,7 @@ |
240 | } |
241 | |
242 | orientationChangesEnabled: priv.mainAppOrientationChangesEnabled |
243 | + mainAppIsFullscreen: mainApp ? mainApp.hideDecorations !== mainApp.fullscreen : false |
244 | |
245 | onWidthChanged: { |
246 | spreadView.selectedIndex = -1; |
247 | @@ -607,6 +608,7 @@ |
248 | dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 && spreadView.phase === 0 ? root.inverseProgress : 0 |
249 | application: ApplicationManager.get(index) |
250 | closeable: !isDash |
251 | + fullscreen: application ? application.hideDecorations !== application.fullscreen : false |
252 | |
253 | readonly property bool wantsMainStage: model.stage == ApplicationInfoInterface.MainStage |
254 | |
255 | |
256 | === modified file 'qml/Stages/TransformedTabletSpreadDelegate.qml' |
257 | --- qml/Stages/TransformedTabletSpreadDelegate.qml 2015-11-04 14:58:05 +0000 |
258 | +++ qml/Stages/TransformedTabletSpreadDelegate.qml 2016-01-26 14:16:15 +0000 |
259 | @@ -371,7 +371,7 @@ |
260 | Scale { |
261 | origin { x: 0; y: (spreadView.height * priv.scale) + maximizedAppTopMargin * 3 } |
262 | xScale: 1 |
263 | - yScale: fullscreen ? 1 - priv.topMarginProgress * maximizedAppTopMargin / spreadView.height : 1 |
264 | + yScale: root.fullscreen ? 1 - priv.topMarginProgress * maximizedAppTopMargin / spreadView.height : 1 |
265 | }, |
266 | Translate { |
267 | x: priv.xTranslate |
268 | |
269 | === modified file 'qml/Tutorial/TutorialRight.qml' |
270 | --- qml/Tutorial/TutorialRight.qml 2015-07-15 15:07:19 +0000 |
271 | +++ qml/Tutorial/TutorialRight.qml 2016-01-26 14:16:15 +0000 |
272 | @@ -163,6 +163,7 @@ |
273 | ListElement { |
274 | appId: "facebook" |
275 | fullscreen: false |
276 | + hideDecorations: false |
277 | name: "" |
278 | icon: "" |
279 | state: ApplicationInfoInterface.Stopped |
280 | @@ -178,6 +179,7 @@ |
281 | ListElement { |
282 | appId: "camera" |
283 | fullscreen: false |
284 | + hideDecorations: false |
285 | name: "" |
286 | icon: "" |
287 | state: ApplicationInfoInterface.Stopped |
288 | @@ -193,6 +195,7 @@ |
289 | ListElement { |
290 | appId: "gallery" |
291 | fullscreen: false |
292 | + hideDecorations: false |
293 | name: "" |
294 | icon: "" |
295 | state: ApplicationInfoInterface.Stopped |
296 | @@ -208,6 +211,7 @@ |
297 | ListElement { |
298 | appId: "dialer" |
299 | fullscreen: false |
300 | + hideDecorations: false |
301 | name: "" |
302 | icon: "" |
303 | state: ApplicationInfoInterface.Stopped |
304 | |
305 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp' |
306 | --- tests/mocks/Unity/Application/ApplicationInfo.cpp 2015-12-08 15:36:53 +0000 |
307 | +++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2016-01-26 14:16:15 +0000 |
308 | @@ -34,6 +34,7 @@ |
309 | , m_state(Stopped) |
310 | , m_focused(false) |
311 | , m_fullscreen(false) |
312 | + , m_hideDecorations(false) |
313 | , m_session(0) |
314 | , m_supportedOrientations(Qt::PortraitOrientation | |
315 | Qt::LandscapeOrientation | |
316 | @@ -53,6 +54,7 @@ |
317 | , m_state(Stopped) |
318 | , m_focused(false) |
319 | , m_fullscreen(false) |
320 | + , m_hideDecorations(false) |
321 | , m_session(0) |
322 | , m_supportedOrientations(Qt::PortraitOrientation | |
323 | Qt::LandscapeOrientation | |
324 | @@ -197,6 +199,14 @@ |
325 | } |
326 | } |
327 | |
328 | +void ApplicationInfo::setHideDecorations(bool value) |
329 | +{ |
330 | + if (value != m_hideDecorations) { |
331 | + m_hideDecorations = value; |
332 | + Q_EMIT hideDecorationsChanged(value); |
333 | + } |
334 | +} |
335 | + |
336 | void ApplicationInfo::setManualSurfaceCreation(bool value) |
337 | { |
338 | if (value != m_manualSurfaceCreation) { |
339 | |
340 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.h' |
341 | --- tests/mocks/Unity/Application/ApplicationInfo.h 2015-12-07 12:35:11 +0000 |
342 | +++ tests/mocks/Unity/Application/ApplicationInfo.h 2016-01-26 14:16:15 +0000 |
343 | @@ -31,6 +31,7 @@ |
344 | Q_OBJECT |
345 | |
346 | Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged) |
347 | + Q_PROPERTY(bool hideDecorations READ hideDecorations WRITE setHideDecorations NOTIFY hideDecorationsChanged) |
348 | Q_PROPERTY(Session* session READ session NOTIFY sessionChanged) |
349 | |
350 | // Only exists in this fake implementation |
351 | @@ -80,6 +81,9 @@ |
352 | void setFullscreen(bool value); |
353 | bool fullscreen() const { return m_fullscreen; } |
354 | |
355 | + void setHideDecorations(bool value); |
356 | + bool hideDecorations() const { return m_hideDecorations; } |
357 | + |
358 | Qt::ScreenOrientations supportedOrientations() const override; |
359 | void setSupportedOrientations(Qt::ScreenOrientations orientations); |
360 | |
361 | @@ -102,6 +106,7 @@ |
362 | Q_SIGNALS: |
363 | void sessionChanged(Session*); |
364 | void fullscreenChanged(bool value); |
365 | + void hideDecorationsChanged(bool value); |
366 | void manualSurfaceCreationChanged(bool value); |
367 | |
368 | public Q_SLOTS: |
369 | @@ -123,6 +128,7 @@ |
370 | State m_state; |
371 | bool m_focused; |
372 | bool m_fullscreen; |
373 | + bool m_hideDecorations; |
374 | Session* m_session; |
375 | Qt::ScreenOrientations m_supportedOrientations; |
376 | bool m_rotatesWindowContents; |
377 | |
378 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp' |
379 | --- tests/mocks/Unity/Application/ApplicationManager.cpp 2015-12-03 18:10:39 +0000 |
380 | +++ tests/mocks/Unity/Application/ApplicationManager.cpp 2016-01-26 14:16:15 +0000 |
381 | @@ -52,6 +52,7 @@ |
382 | { |
383 | m_roleNames.insert(RoleSession, "session"); |
384 | m_roleNames.insert(RoleFullscreen, "fullscreen"); |
385 | + m_roleNames.insert(RoleHideDecorations, "hideDecorations"); |
386 | |
387 | buildListOfAvailableApplications(); |
388 | |
389 | @@ -113,6 +114,8 @@ |
390 | return QVariant::fromValue(app->session()); |
391 | case RoleFullscreen: |
392 | return app->fullscreen(); |
393 | + case RoleHideDecorations: |
394 | + return app->hideDecorations(); |
395 | default: |
396 | return QVariant(); |
397 | } |
398 | @@ -336,7 +339,7 @@ |
399 | application->setName("Camera"); |
400 | application->setScreenshotId("camera"); |
401 | application->setIconId("camera"); |
402 | - application->setFullscreen(true); |
403 | + application->setHideDecorations(true); |
404 | application->setSupportedOrientations(Qt::PortraitOrientation |
405 | | Qt::LandscapeOrientation |
406 | | Qt::InvertedPortraitOrientation |
407 | @@ -349,7 +352,7 @@ |
408 | application->setName("Gallery"); |
409 | application->setScreenshotId("gallery"); |
410 | application->setIconId("gallery"); |
411 | - application->setFullscreen(true); |
412 | + application->setHideDecorations(true); |
413 | application->setStage(ApplicationInfo::MainStage); |
414 | m_availableApplications.append(application); |
415 | |
416 | @@ -363,7 +366,7 @@ |
417 | |
418 | application = new ApplicationInfo(this); |
419 | application->setAppId("webbrowser-app"); |
420 | - application->setFullscreen(true); |
421 | + application->setHideDecorations(true); |
422 | application->setName("Browser"); |
423 | application->setScreenshotId("browser"); |
424 | application->setIconId("browser"); |
425 | @@ -389,7 +392,7 @@ |
426 | application->setName("GMail"); |
427 | application->setIconId("gmail"); |
428 | application->setScreenshotId("gmail-webapp.svg"); |
429 | - application->setFullscreen(false); |
430 | + application->setHideDecorations(false); |
431 | application->setStage(ApplicationInfo::MainStage); |
432 | application->setSupportedOrientations(Qt::PortraitOrientation |
433 | | Qt::LandscapeOrientation |
434 | @@ -402,7 +405,7 @@ |
435 | application->setName("Music"); |
436 | application->setIconId("soundcloud"); |
437 | application->setScreenshotId("music"); |
438 | - application->setFullscreen(false); |
439 | + application->setHideDecorations(false); |
440 | application->setStage(ApplicationInfo::MainStage); |
441 | application->setSupportedOrientations(Qt::PortraitOrientation |
442 | | Qt::LandscapeOrientation |
443 | |
444 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.h' |
445 | --- tests/mocks/Unity/Application/ApplicationManager.h 2015-12-03 18:10:39 +0000 |
446 | +++ tests/mocks/Unity/Application/ApplicationManager.h 2016-01-26 14:16:15 +0000 |
447 | @@ -45,6 +45,7 @@ |
448 | enum MoreRoles { |
449 | RoleSession = RoleExemptFromLifecycle+1, |
450 | RoleFullscreen, |
451 | + RoleHideDecorations, |
452 | }; |
453 | enum Flag { |
454 | NoFlag = 0x0, |
455 | |
456 | === modified file 'tests/mocks/Unity/Application/Session.cpp' |
457 | --- tests/mocks/Unity/Application/Session.cpp 2015-12-01 12:17:24 +0000 |
458 | +++ tests/mocks/Unity/Application/Session.cpp 2016-01-26 14:16:15 +0000 |
459 | @@ -132,10 +132,13 @@ |
460 | { |
461 | if (m_surface) return; |
462 | |
463 | + Mir::State state = Mir::MaximizedState; |
464 | + if (m_application && m_application->fullscreen()) state = Mir::FullscreenState; |
465 | + if (m_application && m_application->hideDecorations()) state = Mir::HorizMaximizedState; |
466 | + |
467 | appendSurface(SurfaceManager::singleton()->createSurface(name(), |
468 | Mir::NormalType, |
469 | - m_application && m_application->fullscreen() ? Mir::FullscreenState : |
470 | - Mir::MaximizedState, |
471 | + state, |
472 | m_screenshot)); |
473 | } |
474 | |
475 | |
476 | === modified file 'tests/qmltests/Panel/tst_Panel.qml' |
477 | --- tests/qmltests/Panel/tst_Panel.qml 2015-11-18 15:12:56 +0000 |
478 | +++ tests/qmltests/Panel/tst_Panel.qml 2016-01-26 14:16:15 +0000 |
479 | @@ -84,9 +84,9 @@ |
480 | } |
481 | |
482 | Button { |
483 | - text: panel.fullscreenMode ? "Maximize" : "FullScreen" |
484 | + text: panel.pinned ? "Unpin Panel" : "Pin Panel" |
485 | Layout.fillWidth: true |
486 | - onClicked: panel.fullscreenMode = !panel.fullscreenMode |
487 | + onClicked: panel.pinned = !panel.pinned |
488 | } |
489 | |
490 | Button { |
491 | @@ -181,7 +181,7 @@ |
492 | } |
493 | |
494 | function init() { |
495 | - panel.fullscreenMode = false; |
496 | + panel.pinned = true; |
497 | callManager.foregroundCall = null; |
498 | |
499 | panel.indicators.hide(); |
500 | @@ -189,7 +189,7 @@ |
501 | tryCompare(panel.indicators.hideAnimation, "running", false); |
502 | |
503 | // Wait for the indicators to get into position. |
504 | - // (switches between normal and fullscreen modes are animated) |
505 | + // (switches between normal and off screen modes are animated) |
506 | var indicatorArea = findChild(panel, "indicatorArea"); |
507 | tryCompare(indicatorArea, "y", 0); |
508 | |
509 | @@ -216,13 +216,13 @@ |
510 | |
511 | function test_drag_show_data() { |
512 | return [ |
513 | - { tag: "pinned", fullscreen: false, call: null, |
514 | + { tag: "pinned", pinned: true, call: null, |
515 | indicatorY: 0 }, |
516 | - { tag: "fullscreen", fullscreen: true, call: null, |
517 | + { tag: "unpinned", pinned: false, call: null, |
518 | indicatorY: -panel.panelAndSeparatorHeight }, |
519 | - { tag: "pinned-callActive", fullscreen: false, call: phoneCall, |
520 | + { tag: "pinned-callActive", pinned: true, call: phoneCall, |
521 | indicatorY: 0}, |
522 | - { tag: "fullscreen-callActive", fullscreen: true, call: phoneCall, |
523 | + { tag: "unpinned-callActive", pinned: false, call: phoneCall, |
524 | indicatorY: -panel.panelAndSeparatorHeight } |
525 | ]; |
526 | } |
527 | @@ -232,7 +232,7 @@ |
528 | // expose more of the panel, binding it to the selected indicator and opening it's menu. |
529 | // Tested from first Y pixel to check for swipe from offscreen. |
530 | function test_drag_show(data) { |
531 | - panel.fullscreenMode = data.fullscreen; |
532 | + panel.pinned = data.pinned; |
533 | callManager.foregroundCall = data.call; |
534 | |
535 | var indicatorRow = findChild(panel.indicators, "indicatorItemRow"); |
536 | @@ -245,7 +245,7 @@ |
537 | verify(indicatorArea !== null); |
538 | |
539 | // Wait for the indicators to get into position. |
540 | - // (switches between normal and fullscreen modes are animated) |
541 | + // (switches between normal and off screen modes are animated) |
542 | tryCompareFunction(function() { return indicatorArea.y }, data.indicatorY); |
543 | |
544 | for (var i = 0; i < root.originalModelData.length; i++) { |
545 | @@ -278,13 +278,13 @@ |
546 | |
547 | function test_drag_hide_data() { |
548 | return [ |
549 | - { tag: "pinned", fullscreen: false, call: null, |
550 | + { tag: "pinned", pinned: true, call: null, |
551 | indicatorY: 0 }, |
552 | - { tag: "fullscreen", fullscreen: true, call: null, |
553 | + { tag: "unpinned", pinned: false, call: null, |
554 | indicatorY: -panel.panelAndSeparatorHeight }, |
555 | - { tag: "pinned-callActive", fullscreen: false, call: phoneCall, |
556 | + { tag: "pinned-callActive", pinned: true, call: phoneCall, |
557 | indicatorY: 0}, |
558 | - { tag: "fullscreen-callActive", fullscreen: true, call: phoneCall, |
559 | + { tag: "unpinned-callActive", pinned: false, call: phoneCall, |
560 | indicatorY: -panel.panelAndSeparatorHeight } |
561 | ]; |
562 | } |
563 | @@ -292,7 +292,7 @@ |
564 | // Dragging the shown indicators up from bottom of panel will hide the indicators |
565 | // Tested from last Y pixel to check for swipe from offscreen. |
566 | function test_drag_hide(data) { |
567 | - panel.fullscreenMode = data.fullscreen; |
568 | + panel.pinned = data.pinned; |
569 | callManager.foregroundCall = data.call; |
570 | |
571 | var indicatorRow = findChild(panel.indicators, "indicatorItemRow"); |
572 | @@ -305,7 +305,7 @@ |
573 | verify(indicatorArea !== null); |
574 | |
575 | // Wait for the indicators to get into position. |
576 | - // (switches between normal and fullscreen modes are animated) |
577 | + // (switches between normal and off screen modes are animated) |
578 | tryCompareFunction(function() { return indicatorArea.y }, data.indicatorY); |
579 | |
580 | panel.indicators.show(); |
581 | @@ -332,19 +332,19 @@ |
582 | |
583 | function test_hint_data() { |
584 | return [ |
585 | - { tag: "normal", fullscreen: false, call: null, hintExpected: true}, |
586 | - { tag: "fullscreen", fullscreen: true, call: null, hintExpected: false}, |
587 | - { tag: "call hint", fullscreen: false, call: phoneCall, hintExpected: false}, |
588 | + { tag: "pinned", pinned: true, call: null, hintExpected: true}, |
589 | + { tag: "unpinned", pinned: false, call: null, hintExpected: false}, |
590 | + { tag: "call hint", pinned: true, call: phoneCall, hintExpected: false}, |
591 | ]; |
592 | } |
593 | |
594 | function test_hint(data) { |
595 | - panel.fullscreenMode = data.fullscreen; |
596 | + panel.pinned = data.pinned; |
597 | callManager.foregroundCall = data.call; |
598 | |
599 | - if (data.fullscreen) { |
600 | + if (!data.pinned) { |
601 | // Wait for the indicators to get into position. |
602 | - // (switches between normal and fullscreen modes are animated) |
603 | + // (switches between normal and offscreen modes are animated) |
604 | var indicatorArea = findChild(panel, "indicatorArea"); |
605 | tryCompare(indicatorArea, "y", -panel.panelHeight); |
606 | } |
607 | @@ -357,7 +357,7 @@ |
608 | // Give some time for a hint animation to change things, if any |
609 | wait(500); |
610 | |
611 | - // no hint animation when fullscreen |
612 | + // no hint animation when off screen |
613 | compare(panel.indicators.fullyClosed, !data.hintExpected, "Indicator should be fully closed"); |
614 | compare(panel.indicators.partiallyOpened, data.hintExpected, "Indicator should be partialy opened"); |
615 | compare(panel.indicators.fullyOpened, false, "Indicator should not be fully opened"); |
616 | @@ -426,17 +426,17 @@ |
617 | |
618 | /* |
619 | Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1439318 |
620 | - When the panel is in fullscreen mode and the user taps near the top edge, |
621 | + When the panel is in off screen mode and the user taps near the top edge, |
622 | the panel should take no action and the tap should reach the item behind the |
623 | panel. |
624 | */ |
625 | - function test_tapNearTopEdgeWithPanelInFullscreenMode() { |
626 | + function test_tapNearTopEdgeWithPanelInUnPinnedMode() { |
627 | var indicatorArea = findChild(panel, "indicatorArea"); |
628 | verify(indicatorArea); |
629 | var panelPriv = findInvisibleChild(panel, "panelPriv"); |
630 | verify(panelPriv); |
631 | |
632 | - panel.fullscreenMode = true; |
633 | + panel.pinned = true; |
634 | // wait until if finishes hiding itself |
635 | tryCompare(indicatorArea, "y", -panelPriv.indicatorHeight); |
636 | |
637 | |
638 | === modified file 'tests/qmltests/tst_Shell.qml' |
639 | --- tests/qmltests/tst_Shell.qml 2015-12-08 15:37:51 +0000 |
640 | +++ tests/qmltests/tst_Shell.qml 2016-01-26 14:16:15 +0000 |
641 | @@ -209,6 +209,26 @@ |
642 | color: "white" |
643 | } |
644 | |
645 | + Label { text: "Focused Application"; font.bold: true } |
646 | + |
647 | + Row { |
648 | + anchors { left: parent.left; right: parent.right } |
649 | + spacing: units.gu(1) |
650 | + Button { |
651 | + property QtObject application: ApplicationManager.findApplication(ApplicationManager.focusedApplicationId) |
652 | + text: "Fullscreen" |
653 | + color: application.fullscreen ? UbuntuColors.green : UbuntuColors.lightGrey |
654 | + onClicked: application.fullscreen = !application.fullscreen |
655 | + } |
656 | + |
657 | + Button { |
658 | + property QtObject application: ApplicationManager.findApplication(ApplicationManager.focusedApplicationId) |
659 | + text: "Hide Decorations" |
660 | + color: application.hideDecorations ? UbuntuColors.green : UbuntuColors.lightGrey |
661 | + onClicked: application.hideDecorations = !application.hideDecorations |
662 | + } |
663 | + } |
664 | + |
665 | Label { text: "Applications"; font.bold: true } |
666 | |
667 | Button { |
668 | @@ -1031,40 +1051,40 @@ |
669 | tryCompare(sessionSpy, "count", 1); |
670 | } |
671 | |
672 | - function test_fullscreen() { |
673 | + function test_unpinnedMode() { |
674 | loadShell("phone"); |
675 | swipeAwayGreeter(); |
676 | var panel = findChild(shell, "panel"); |
677 | - compare(panel.fullscreenMode, false); |
678 | + compare(panel.pinned, true); |
679 | ApplicationManager.startApplication("camera-app"); |
680 | - tryCompare(panel, "fullscreenMode", true); |
681 | + tryCompare(panel, "pinned", false); |
682 | ApplicationManager.startApplication("dialer-app"); |
683 | - tryCompare(panel, "fullscreenMode", false); |
684 | + tryCompare(panel, "pinned", true); |
685 | ApplicationManager.requestFocusApplication("camera-app"); |
686 | - tryCompare(panel, "fullscreenMode", true); |
687 | + tryCompare(panel, "pinned", false); |
688 | ApplicationManager.requestFocusApplication("dialer-app"); |
689 | - tryCompare(panel, "fullscreenMode", false); |
690 | + tryCompare(panel, "pinned", true); |
691 | } |
692 | |
693 | - function test_leftEdgeDragFullscreen() { |
694 | + function test_leftEdgeDragPinnedMode() { |
695 | loadShell("phone"); |
696 | swipeAwayGreeter(); |
697 | var panel = findChild(shell, "panel"); |
698 | - tryCompare(panel, "fullscreenMode", false) |
699 | + tryCompare(panel, "pinned", true) |
700 | |
701 | ApplicationManager.startApplication("camera-app"); |
702 | - tryCompare(panel, "fullscreenMode", true) |
703 | + tryCompare(panel, "pinned", false) |
704 | |
705 | var touchStartX = 2; |
706 | var touchStartY = shell.height / 2; |
707 | |
708 | touchFlick(shell, touchStartX, touchStartY, units.gu(2), touchStartY, true, false); |
709 | |
710 | - compare(panel.fullscreenMode, true); |
711 | + compare(panel.pinned, false); |
712 | |
713 | touchFlick(shell, units.gu(2), touchStartY, shell.width * 0.5, touchStartY, false, false); |
714 | |
715 | - tryCompare(panel, "fullscreenMode", false); |
716 | + tryCompare(panel, "pinned", true); |
717 | |
718 | touchRelease(shell); |
719 | } |
720 | |
721 | === modified file 'tests/qmltests/tst_ShellWithPin.qml' |
722 | --- tests/qmltests/tst_ShellWithPin.qml 2015-12-01 12:17:24 +0000 |
723 | +++ tests/qmltests/tst_ShellWithPin.qml 2016-01-26 14:16:15 +0000 |
724 | @@ -297,7 +297,7 @@ |
725 | tryCompare(greeter, "lockedApp", "dialer-app") |
726 | tryCompare(greeter, "hasLockedApp", true) |
727 | tryCompare(greeter, "shown", false); |
728 | - tryCompare(panel, "fullscreenMode", true) |
729 | + tryCompare(panel, "pinned", false) |
730 | tryCompare(indicators, "available", false) |
731 | tryCompare(launcher, "available", false) |
732 | tryCompare(stage, "spreadEnabled", false) |
733 | @@ -310,7 +310,7 @@ |
734 | tryCompare(greeter, "lockedApp", "") |
735 | tryCompare(greeter, "hasLockedApp", false) |
736 | tryCompare(greeter, "fullyShown", true); |
737 | - tryCompare(panel, "fullscreenMode", false) |
738 | + tryCompare(panel, "pinned", true) |
739 | tryCompare(indicators, "available", true) |
740 | tryCompare(launcher, "available", true) |
741 | tryCompare(stage, "spreadEnabled", false) |