on xenial help sign in
drop applicationsdisplayloader, rename DesktopStage to Stage
commit280d2968135bd4b3fae127f46c1d45af8303ec13 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 3 Aug 2016, 18:29 (10 years ago) parent4f02382
48 files changed+57−167
qml/Shell.qml+51−163 qml/Stages/AbstractStage.qml → qml/Stage/AbstractStage.qml qml/Stages/ApplicationWindow.qml → qml/Stage/ApplicationWindow.qml qml/Stages/DecoratedWindow.qml → qml/Stage/DecoratedWindow.qml qml/Stages/DesktopSpread.qml → qml/Stage/DesktopSpread.qml qml/Stages/DesktopSpreadDelegate.qml → qml/Stage/DesktopSpreadDelegate.qml qml/Stages/MainViewStyle.qml → qml/Stage/MainViewStyle.qml qml/Stages/OrientationChangeAnimation.qml → qml/Stage/OrientationChangeAnimation.qml qml/Stages/PhoneStage.qml → qml/Stage/PhoneStage.qml qml/Stages/PromptSurfaceAnimations.qml → qml/Stage/PromptSurfaceAnimations.qml qml/Stages/ResizeGrip.qml → qml/Stage/ResizeGrip.qml qml/Stages/SideStage.qml → qml/Stage/SideStage.qml qml/Stages/Splash.qml → qml/Stage/Splash.qml qml/Stages/Spread/BezierCurve.qml → qml/Stage/Spread/BezierCurve.qml qml/Stages/Spread/KeySpline.js → qml/Stage/Spread/KeySpline.js qml/Stages/Spread/MathUtils.js → qml/Stage/Spread/MathUtils.js qml/Stages/Spread/Spread.qml → qml/Stage/Spread/Spread.qml qml/Stages/Spread/SpreadDelegateInputArea.qml → qml/Stage/Spread/SpreadDelegateInputArea.qml qml/Stages/Spread/SpreadMaths.qml → qml/Stage/Spread/SpreadMaths.qml qml/Stages/Spread/StagedRightEdgeMaths.qml → qml/Stage/Spread/StagedRightEdgeMaths.qml qml/Stages/Spread/cubic-bezier.js → qml/Stage/Spread/cubic-bezier.js qml/Stages/SpreadDelegate.qml → qml/Stage/SpreadDelegate.qml qml/Stages/DesktopStage.qml → qml/Stage/Stage.qml+6−4 qml/Stages/StageMaths.qml → qml/Stage/StageMaths.qml qml/Stages/StagedFullscreenPolicy.qml → qml/Stage/StagedFullscreenPolicy.qml qml/Stages/SurfaceContainer.qml → qml/Stage/SurfaceContainer.qml qml/Stages/TabletSideStageTouchGesture.qml → qml/Stage/TabletSideStageTouchGesture.qml qml/Stages/TabletStage.qml → qml/Stage/TabletStage.qml qml/Stages/TopLevelSurfaceRepeater.qml → qml/Stage/TopLevelSurfaceRepeater.qml qml/Stages/TransformedSpreadDelegate.qml → qml/Stage/TransformedSpreadDelegate.qml qml/Stages/TransformedTabletSpreadDelegate.qml → qml/Stage/TransformedTabletSpreadDelegate.qml qml/Stages/WindowControlsOverlay.qml → qml/Stage/WindowControlsOverlay.qml qml/Stages/WindowDecoration.qml → qml/Stage/WindowDecoration.qml qml/Stages/WindowInfoItem.qml → qml/Stage/WindowInfoItem.qml qml/Stages/WindowResizeArea.qml → qml/Stage/WindowResizeArea.qml qml/Stages/WindowedFullscreenPolicy.qml → qml/Stage/WindowedFullscreenPolicy.qml qml/Stages/graphics/PageHeaderBaseDividerBottom@18.png → qml/Stage/graphics/PageHeaderBaseDividerBottom@18.png qml/Stages/graphics/PageHeaderBaseDividerLight@18.png → qml/Stage/graphics/PageHeaderBaseDividerLight@18.png qml/Stages/graphics/PageHeaderBaseDividerLight@18.sci → qml/Stage/graphics/PageHeaderBaseDividerLight@18.sci qml/Stages/graphics/arrows-centre.png → qml/Stage/graphics/arrows-centre.png qml/Stages/graphics/arrows.png → qml/Stage/graphics/arrows.png qml/Stages/graphics/dropshadow2gu@30.png → qml/Stage/graphics/dropshadow2gu@30.png qml/Stages/graphics/dropshadow2gu@30.sci → qml/Stage/graphics/dropshadow2gu@30.sci qml/Stages/graphics/sidestage_drag.svg → qml/Stage/graphics/sidestage_drag.svg qml/Stages/graphics/sidestage_handle@20.png → qml/Stage/graphics/sidestage_handle@20.png qml/Stages/graphics/sidestage_handle@20.sci → qml/Stage/graphics/sidestage_handle@20.sci qml/Stages/graphics/sidestage_open.svg → qml/Stage/graphics/sidestage_open.svg qml/Stages/graphics/window-close.svg → qml/Stage/graphics/window-close.svg
qml/Shell.qml+51−163
@@ -34,7 +34,7 @@ import "Launcher"
3434import "Panel"
3535import "Components"
3636import "Notifications"
37−import "Stages"
37+import "Stage"
3838import "Tutorial"
3939import "Wizard"
4040import Unity.Notifications 1.0 as NotificationBackend
@@ -62,19 +62,18 @@ StyledItem {
6262 property string mode: "full-greeter"
6363 property alias oskEnabled: inputMethod.enabled
6464 function updateFocusedAppOrientation() {
65− applicationsDisplayLoader.item.updateFocusedAppOrientation();
65+ stage.updateFocusedAppOrientation();
6666 }
6767 function updateFocusedAppOrientationAnimated() {
68− applicationsDisplayLoader.item.updateFocusedAppOrientationAnimated();
68+ stage.updateFocusedAppOrientationAnimated();
6969 }
7070 property bool hasMouse: false
7171
7272 // to be read from outside
73− readonly property int mainAppWindowOrientationAngle:
74− applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainAppWindowOrientationAngle : 0
73+ readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
7574
7675 readonly property bool orientationChangesEnabled: panel.indicators.fullyClosed
77− && (applicationsDisplayLoader.item && applicationsDisplayLoader.item.orientationChangesEnabled)
76+ && stage.orientationChangesEnabled
7877 && (!greeter || !greeter.animating)
7978
8079 readonly property bool showingGreeter: greeter && greeter.shown
@@ -88,19 +87,13 @@ StyledItem {
8887 return Qt.PrimaryOrientation;
8988 } else if (greeter && greeter.shown) {
9089 return Qt.PrimaryOrientation;
91− } else if (applicationsDisplayLoader.item) {
92− return shell.orientations.map(applicationsDisplayLoader.item.supportedOrientations);
9390 } else {
94− // we just don't care
95− return Qt.PortraitOrientation
96− | Qt.LandscapeOrientation
97− | Qt.InvertedPortraitOrientation
98− | Qt.InvertedLandscapeOrientation;
91+ return shell.orientations.map(stage.supportedOrientations);
9992 }
10093 }
10194
102− readonly property var mainApp:
103− applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainApp : null
95+ readonly property var mainApp: stage.mainApp
96+
10497 onMainAppChanged: {
10598 if (mainApp) {
10699 _onMainAppChanged(mainApp.appId);
@@ -241,157 +234,53 @@ StyledItem {
241234 applicationsModel: ApplicationManager
242235 }
243236
244− Loader {
245− id: applicationsDisplayLoader
246− objectName: "applicationsDisplayLoader"
237+ Stage {
238+ id: stage
239+ objectName: "stage"
247240 anchors.fill: parent
241+ focus: true
248242
249− // When we have a locked app, we only want to show that one app.
250− // FIXME: do this in a less traumatic way. We currently only allow
251− // locked apps in phone mode (see FIXME in Lockscreen component in
252− // this same file). When that changes, we need to do something
253− // nicer here. But this code is currently just to prevent a
254− // theoretical attack where user enters lockedApp mode, then makes
255− // the screen larger (maybe connects to monitor) and tries to enter
256− // tablet mode.
243+ dragAreaWidth: shell.edgeSize
244+ background: wallpaperResolver.background
257245
258− property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
259− ? "phone"
260− : shell.usageScenario
261−
262− source: "Stages/DesktopStage.qml"
263− readonly property string qmlComponent: {
264− if (shell.mode === "greeter") {
265− return "Stages/AbstractStage.qml"
266− } else if (applicationsDisplayLoader.usageScenario === "phone") {
267− return "Stages/PhoneStage.qml";
268− } else if (applicationsDisplayLoader.usageScenario === "tablet") {
269− return "Stages/TabletStage.qml";
270− } else {
271− return "Stages/DesktopStage.qml";
272− }
273− }
246+ applicationManager: ApplicationManager
247+ topLevelSurfaceList: topLevelSurfaceList
274248
275− property bool interactive: (!greeter || !greeter.shown)
249+ property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
250+ ? "phone"
251+ : shell.usageScenario
252+
253+ mode: usageScenario == "phone" ? "staged"
254+ : usageScenario == "tablet" ? "stagedWithSideStage"
255+ : "windowed"
256+
257+ shellOrientation: shell.orientation
258+ shellOrientationAngle: shell.orientationAngle
259+ orientations: shell.orientations
260+ nativeWidth: shell.nativeWidth
261+ nativeHeight: shell.nativeHeight
262+ // TODO: Is this still needed? Didn't come across it. Needs checking before merging
263+ beingResized: shell.beingResized
264+
265+ // TODO: Is this still needed? Didn't come across it. Needs checking before merging
266+ // Not just using panel.panelHeight as that changes depending on the focused app.
267+ maximizedAppTopMargin: panel.indicators.minimizedPanelHeight
268+
269+ interactive: (!greeter || !greeter.shown)
276270 && panel.indicators.fullyClosed
277271 && launcher.progress == 0
278272 && !notifications.useModal
279273
280− onInteractiveChanged: { if (interactive) { focus = true; } }
274+ // TODO: This is not implemented yet in the new stage...
275+ spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
276+ keepDashRunning: launcher.shown || launcher.dashSwipe
277+ suspended: greeter.shown
278+ leftMargin: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
281279
282− Binding {
283− target: applicationsDisplayLoader.item
284− property: "mode"
285− value: applicationsDisplayLoader.usageScenario == "phone" ? "staged"
286− : applicationsDisplayLoader.usageScenario == "tablet" ? "stagedWithSideStage"
287− : "windowed"
288− }
289− Binding {
290− target: applicationsDisplayLoader.item
291− property: "focus"
292− value: true
293− }
294− Binding {
295− target: applicationsDisplayLoader.item
296− property: "objectName"
297− value: "stage"
298− }
299− Binding {
300− target: applicationsDisplayLoader.item
301− property: "dragAreaWidth"
302− value: shell.edgeSize
303− }
304− Binding {
305− target: applicationsDisplayLoader.item
306− property: "maximizedAppTopMargin"
307− // Not just using panel.panelHeight as that changes depending on the focused app.
308− value: panel.indicators.minimizedPanelHeight
309− }
310− Binding {
311− target: applicationsDisplayLoader.item
312− property: "interactive"
313− value: applicationsDisplayLoader.interactive
314− }
315− Binding {
316− target: applicationsDisplayLoader.item
317− property: "spreadEnabled"
318− value: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
319− }
320− Binding {
321− target: applicationsDisplayLoader.item
322− property: "inverseProgress"
323− value: !greeter || greeter.locked || !tutorial.launcherLongSwipeEnabled ? 0 : launcher.progress
324− }
325− Binding {
326− target: applicationsDisplayLoader.item
327− property: "shellOrientationAngle"
328− value: shell.orientationAngle
329− }
330− Binding {
331− target: applicationsDisplayLoader.item
332− property: "shellOrientation"
333− value: shell.orientation
334− }
335− Binding {
336− target: applicationsDisplayLoader.item
337− property: "orientations"
338− value: shell.orientations
339− }
340− Binding {
341− target: applicationsDisplayLoader.item
342− property: "background"
343− value: wallpaperResolver.background
344− }
345− Binding {
346− target: applicationsDisplayLoader.item
347− property: "nativeWidth"
348− value: shell.nativeWidth
349− }
350− Binding {
351− target: applicationsDisplayLoader.item
352− property: "nativeHeight"
353− value: shell.nativeHeight
354− }
355− Binding {
356− target: applicationsDisplayLoader.item
357− property: "beingResized"
358− value: shell.beingResized
359− }
360− Binding {
361− target: applicationsDisplayLoader.item
362− property: "keepDashRunning"
363− value: launcher.shown || launcher.dashSwipe
364− }
365− Binding {
366− target: applicationsDisplayLoader.item
367− property: "suspended"
368− value: greeter.shown
369− }
370− Binding {
371− target: applicationsDisplayLoader.item
372− property: "altTabPressed"
373− value: physicalKeysMapper.altTabPressed
374− }
375− Binding {
376− target: applicationsDisplayLoader.item
377− property: "leftMargin"
378− value: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
379− }
380− Binding {
381− target: applicationsDisplayLoader.item
382− property: "applicationManager"
383− value: ApplicationManager
384− }
385− Binding {
386− target: applicationsDisplayLoader.item
387− property: "topLevelSurfaceList"
388− value: topLevelSurfaceList
389− }
390− Binding {
391− target: applicationsDisplayLoader.item
392− property: "oskEnabled"
393− value: shell.oskEnabled
394− }
280+ // TODO: this is not implemented yet in the new stage...
281+ inverseProgress: !greeter || greeter.locked || !tutorial.launcherLongSwipeEnabled ? 0 : launcher.progress
282+ altTabPressed: physicalKeysMapper.altTabPressed
283+ oskEnabled: shell.oskEnabled
395284 }
396285 }
397286
@@ -610,7 +499,7 @@ StyledItem {
610499 }
611500 onFocusChanged: {
612501 if (!focus) {
613− applicationsDisplayLoader.focus = true;
502+ shell.focus = true;
614503 }
615504 }
616505
@@ -671,7 +560,7 @@ StyledItem {
671560 lastInputTimestamp: inputFilter.lastInputTimestamp
672561 launcher: launcher
673562 panel: panel
674− stage: applicationsDisplayLoader.item
563+ stage: stage
675564 }
676565
677566 Wizard {
@@ -755,7 +644,7 @@ StyledItem {
755644 z: dialogs.z + 10
756645 GlobalShortcut { shortcut: Qt.Key_Print; onTriggered: itemGrabber.capture(shell) }
757646 Connections {
758− target: applicationsDisplayLoader.item
647+ target: stage
759648 ignoreUnknownSignals: true
760649 onItemSnapshotRequested: itemGrabber.capture(item)
761650 }
@@ -783,9 +672,8 @@ StyledItem {
783672 }
784673
785674 onPushedRightBoundary: {
786− if (buttons === Qt.NoButton && applicationsDisplayLoader.item
787− && applicationsDisplayLoader.item.pushRightEdge) {
788− applicationsDisplayLoader.item.pushRightEdge(amount);
675+ if (buttons === Qt.NoButton) {
676+ stage.pushRightEdge(amount);
789677 }
790678 }
791679
qml/Stages/AbstractStage.qml → qml/Stage/AbstractStage.qmlrenamed

The content is the same.

qml/Stages/ApplicationWindow.qml → qml/Stage/ApplicationWindow.qmlrenamed

The content is the same.

qml/Stages/DecoratedWindow.qml → qml/Stage/DecoratedWindow.qmlrenamed

The content is the same.

qml/Stages/DesktopSpread.qml → qml/Stage/DesktopSpread.qmlrenamed

The content is the same.

qml/Stages/DesktopSpreadDelegate.qml → qml/Stage/DesktopSpreadDelegate.qmlrenamed

The content is the same.

qml/Stages/MainViewStyle.qml → qml/Stage/MainViewStyle.qmlrenamed

The content is the same.

qml/Stages/OrientationChangeAnimation.qml → qml/Stage/OrientationChangeAnimation.qmlrenamed

The content is the same.

qml/Stages/PhoneStage.qml → qml/Stage/PhoneStage.qmlrenamed

The content is the same.

qml/Stages/PromptSurfaceAnimations.qml → qml/Stage/PromptSurfaceAnimations.qmlrenamed

The content is the same.

qml/Stages/ResizeGrip.qml → qml/Stage/ResizeGrip.qmlrenamed

The content is the same.

qml/Stages/SideStage.qml → qml/Stage/SideStage.qmlrenamed

The content is the same.

qml/Stages/Splash.qml → qml/Stage/Splash.qmlrenamed

The content is the same.

qml/Stages/Spread/BezierCurve.qml → qml/Stage/Spread/BezierCurve.qmlrenamed

The content is the same.

qml/Stages/Spread/KeySpline.js → qml/Stage/Spread/KeySpline.jsrenamed

The content is the same.

qml/Stages/Spread/MathUtils.js → qml/Stage/Spread/MathUtils.jsrenamed

The content is the same.

qml/Stages/Spread/Spread.qml → qml/Stage/Spread/Spread.qmlrenamed

The content is the same.

qml/Stages/Spread/SpreadDelegateInputArea.qml → qml/Stage/Spread/SpreadDelegateInputArea.qmlrenamed

The content is the same.

qml/Stages/Spread/SpreadMaths.qml → qml/Stage/Spread/SpreadMaths.qmlrenamed

The content is the same.

qml/Stages/Spread/StagedRightEdgeMaths.qml → qml/Stage/Spread/StagedRightEdgeMaths.qmlrenamed

The content is the same.

qml/Stages/Spread/cubic-bezier.js → qml/Stage/Spread/cubic-bezier.jsrenamed

The content is the same.

qml/Stages/SpreadDelegate.qml → qml/Stage/SpreadDelegate.qmlrenamed

The content is the same.

qml/Stages/DesktopStage.qml → qml/Stage/Stage.qmlrenamed+6−4
@@ -121,8 +121,8 @@ AbstractStage {
121121
122122 property bool goneToSpread: false
123123 property int closingIndex: -1
124−// property int animationDuration: 4000
125− property int animationDuration: UbuntuAnimation.FastDuration
124+ property int animationDuration: 4000
125+// property int animationDuration: UbuntuAnimation.FastDuration
126126
127127 function updateForegroundMaximizedApp() {
128128 var found = false;
@@ -733,13 +733,15 @@ AbstractStage {
733733 }
734734
735735 function playFocusAnimation() {
736− if (state == "sidestagedrightedge") {
736+ print("playing focus animation", state, root.mode, "app", model.application.appId)
737+ if (state == "stagedrightedge") {
737738 // TODO: Can we drop this if and find something that always works?
738739 if (root.mode == "staged") {
739740 rightEdgeFocusAnimation.targetX = 0
741+ print("doing it to 0")
740742 rightEdgeFocusAnimation.start()
741743 } else if (root.mode == "stagedWithSideStage") {
742− rightEdgeFocusAnimation.targetX = appDelegate.stage == ApplicationInfoInterface.SideStage ? sideStage.x : 0
744+ rightEdgeFocusAnimation.targetX = appDelegate.stage == ApplicationInfoInterface.SideStage ? sideStage.x : 0
743745 rightEdgeFocusAnimation.start()
744746 }
745747 } else {
qml/Stages/StageMaths.qml → qml/Stage/StageMaths.qmlrenamed

The content is the same.

qml/Stages/StagedFullscreenPolicy.qml → qml/Stage/StagedFullscreenPolicy.qmlrenamed

The content is the same.

qml/Stages/SurfaceContainer.qml → qml/Stage/SurfaceContainer.qmlrenamed

The content is the same.

qml/Stages/TabletSideStageTouchGesture.qml → qml/Stage/TabletSideStageTouchGesture.qmlrenamed

The content is the same.

qml/Stages/TabletStage.qml → qml/Stage/TabletStage.qmlrenamed

The content is the same.

qml/Stages/TopLevelSurfaceRepeater.qml → qml/Stage/TopLevelSurfaceRepeater.qmlrenamed

The content is the same.

qml/Stages/TransformedSpreadDelegate.qml → qml/Stage/TransformedSpreadDelegate.qmlrenamed

The content is the same.

qml/Stages/TransformedTabletSpreadDelegate.qml → qml/Stage/TransformedTabletSpreadDelegate.qmlrenamed

The content is the same.

qml/Stages/WindowControlsOverlay.qml → qml/Stage/WindowControlsOverlay.qmlrenamed

The content is the same.

qml/Stages/WindowDecoration.qml → qml/Stage/WindowDecoration.qmlrenamed

The content is the same.

qml/Stages/WindowInfoItem.qml → qml/Stage/WindowInfoItem.qmlrenamed

The content is the same.

qml/Stages/WindowResizeArea.qml → qml/Stage/WindowResizeArea.qmlrenamed

The content is the same.

qml/Stages/WindowedFullscreenPolicy.qml → qml/Stage/WindowedFullscreenPolicy.qmlrenamed

The content is the same.

qml/Stages/graphics/PageHeaderBaseDividerBottom@18.png → qml/Stage/graphics/PageHeaderBaseDividerBottom@18.pngrenamed

Binary file not shown.

qml/Stages/graphics/PageHeaderBaseDividerLight@18.png → qml/Stage/graphics/PageHeaderBaseDividerLight@18.pngrenamed

Binary file not shown.

qml/Stages/graphics/PageHeaderBaseDividerLight@18.sci → qml/Stage/graphics/PageHeaderBaseDividerLight@18.scirenamed

The content is the same.

qml/Stages/graphics/arrows-centre.png → qml/Stage/graphics/arrows-centre.pngrenamed

Binary file not shown.

qml/Stages/graphics/arrows.png → qml/Stage/graphics/arrows.pngrenamed

Binary file not shown.

qml/Stages/graphics/dropshadow2gu@30.png → qml/Stage/graphics/dropshadow2gu@30.pngrenamed

Binary file not shown.

qml/Stages/graphics/dropshadow2gu@30.sci → qml/Stage/graphics/dropshadow2gu@30.scirenamed

The content is the same.

qml/Stages/graphics/sidestage_drag.svg → qml/Stage/graphics/sidestage_drag.svgrenamed

The content is the same.

qml/Stages/graphics/sidestage_handle@20.png → qml/Stage/graphics/sidestage_handle@20.pngrenamed

Binary file not shown.

qml/Stages/graphics/sidestage_handle@20.sci → qml/Stage/graphics/sidestage_handle@20.scirenamed

The content is the same.

qml/Stages/graphics/sidestage_open.svg → qml/Stage/graphics/sidestage_open.svgrenamed

The content is the same.

qml/Stages/graphics/window-close.svg → qml/Stage/graphics/window-close.svgrenamed

The content is the same.