on xenial help sign in
drop applicationsdisplayloader, rename DesktopStage to Stage
280d296Michael Zanetti
qml/Shell.qml+51−163
@@ -34,7 +34,7 @@ import "Launcher"
34import "Panel"
34import "Panel"
35import "Components"
35import "Components"
36import "Notifications"
36import "Notifications"
37−import "Stages"
37+import "Stage"
38import "Tutorial"
38import "Tutorial"
39import "Wizard"
39import "Wizard"
40import Unity.Notifications 1.0 as NotificationBackend
40import Unity.Notifications 1.0 as NotificationBackend
@@ -62,19 +62,18 @@ StyledItem {
62 property string mode: "full-greeter"
62 property string mode: "full-greeter"
63 property alias oskEnabled: inputMethod.enabled
63 property alias oskEnabled: inputMethod.enabled
64 function updateFocusedAppOrientation() {
64 function updateFocusedAppOrientation() {
65− applicationsDisplayLoader.item.updateFocusedAppOrientation();
65+ stage.updateFocusedAppOrientation();
66 }
66 }
67 function updateFocusedAppOrientationAnimated() {
67 function updateFocusedAppOrientationAnimated() {
68− applicationsDisplayLoader.item.updateFocusedAppOrientationAnimated();
68+ stage.updateFocusedAppOrientationAnimated();
69 }
69 }
70 property bool hasMouse: false
70 property bool hasMouse: false
71
71
72 // to be read from outside
72 // to be read from outside
73− readonly property int mainAppWindowOrientationAngle:
73+ readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
74− applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainAppWindowOrientationAngle : 0
75
74
76 readonly property bool orientationChangesEnabled: panel.indicators.fullyClosed
75 readonly property bool orientationChangesEnabled: panel.indicators.fullyClosed
77− && (applicationsDisplayLoader.item && applicationsDisplayLoader.item.orientationChangesEnabled)
76+ && stage.orientationChangesEnabled
78 && (!greeter || !greeter.animating)
77 && (!greeter || !greeter.animating)
79
78
80 readonly property bool showingGreeter: greeter && greeter.shown
79 readonly property bool showingGreeter: greeter && greeter.shown
@@ -88,19 +87,13 @@ StyledItem {
88 return Qt.PrimaryOrientation;
87 return Qt.PrimaryOrientation;
89 } else if (greeter && greeter.shown) {
88 } else if (greeter && greeter.shown) {
90 return Qt.PrimaryOrientation;
89 return Qt.PrimaryOrientation;
91− } else if (applicationsDisplayLoader.item) {
92− return shell.orientations.map(applicationsDisplayLoader.item.supportedOrientations);
93 } else {
90 } else {
94− // we just don't care
91+ return shell.orientations.map(stage.supportedOrientations);
95− return Qt.PortraitOrientation
96− | Qt.LandscapeOrientation
97− | Qt.InvertedPortraitOrientation
98− | Qt.InvertedLandscapeOrientation;
99 }
92 }
100 }
93 }
101
94
102− readonly property var mainApp:
95+ readonly property var mainApp: stage.mainApp
103− applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainApp : null
96+
104 onMainAppChanged: {
97 onMainAppChanged: {
105 if (mainApp) {
98 if (mainApp) {
106 _onMainAppChanged(mainApp.appId);
99 _onMainAppChanged(mainApp.appId);
@@ -241,157 +234,53 @@ StyledItem {
241 applicationsModel: ApplicationManager
234 applicationsModel: ApplicationManager
242 }
235 }
243
236
244− Loader {
237+ Stage {
245− id: applicationsDisplayLoader
238+ id: stage
246− objectName: "applicationsDisplayLoader"
239+ objectName: "stage"
247 anchors.fill: parent
240 anchors.fill: parent
241+ focus: true
248
242
249− // When we have a locked app, we only want to show that one app.
243+ dragAreaWidth: shell.edgeSize
250− // FIXME: do this in a less traumatic way. We currently only allow
244+ background: wallpaperResolver.background
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.
257
245
258− property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
246+ applicationManager: ApplicationManager
259− ? "phone"
247+ topLevelSurfaceList: topLevelSurfaceList
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− }
274
248
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+
275− property bool interactive: (!greeter || !greeter.shown)
269+ interactive: (!greeter || !greeter.shown)
276 && panel.indicators.fullyClosed
270 && panel.indicators.fullyClosed
277 && launcher.progress == 0
271 && launcher.progress == 0
278 && !notifications.useModal
272 && !notifications.useModal
279
273
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
281
279
282− Binding {
280+ // TODO: this is not implemented yet in the new stage...
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
281+ inverseProgress: !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
282+ altTabPressed: 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
283+ oskEnabled: shell.oskEnabled
394− }
395 }
284 }
396 }
285 }
397
286
@@ -610,7 +499,7 @@ StyledItem {
610 }
499 }
611 onFocusChanged: {
500 onFocusChanged: {
612 if (!focus) {
501 if (!focus) {
613− applicationsDisplayLoader.focus = true;
502+ shell.focus = true;
614 }
503 }
615 }
504 }
616
505
@@ -671,7 +560,7 @@ StyledItem {
671 lastInputTimestamp: inputFilter.lastInputTimestamp
560 lastInputTimestamp: inputFilter.lastInputTimestamp
672 launcher: launcher
561 launcher: launcher
673 panel: panel
562 panel: panel
674− stage: applicationsDisplayLoader.item
563+ stage: stage
675 }
564 }
676
565
677 Wizard {
566 Wizard {
@@ -755,7 +644,7 @@ StyledItem {
755 z: dialogs.z + 10
644 z: dialogs.z + 10
756 GlobalShortcut { shortcut: Qt.Key_Print; onTriggered: itemGrabber.capture(shell) }
645 GlobalShortcut { shortcut: Qt.Key_Print; onTriggered: itemGrabber.capture(shell) }
757 Connections {
646 Connections {
758− target: applicationsDisplayLoader.item
647+ target: stage
759 ignoreUnknownSignals: true
648 ignoreUnknownSignals: true
760 onItemSnapshotRequested: itemGrabber.capture(item)
649 onItemSnapshotRequested: itemGrabber.capture(item)
761 }
650 }
@@ -783,9 +672,8 @@ StyledItem {
783 }
672 }
784
673
785 onPushedRightBoundary: {
674 onPushedRightBoundary: {
786− if (buttons === Qt.NoButton && applicationsDisplayLoader.item
675+ if (buttons === Qt.NoButton) {
787− && applicationsDisplayLoader.item.pushRightEdge) {
788− applicationsDisplayLoader.item.pushRightEdge(amount);
676+ stage.pushRightEdge(amount);
789 }
677 }
790 }
678 }
791
679
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 {
121
121
122 property bool goneToSpread: false
122 property bool goneToSpread: false
123 property int closingIndex: -1
123 property int closingIndex: -1
124−// property int animationDuration: 4000
124+ property int animationDuration: 4000
125− property int animationDuration: UbuntuAnimation.FastDuration
125+// property int animationDuration: UbuntuAnimation.FastDuration
126
126
127 function updateForegroundMaximizedApp() {
127 function updateForegroundMaximizedApp() {
128 var found = false;
128 var found = false;
@@ -733,13 +733,15 @@ AbstractStage {
733 }
733 }
734
734
735 function playFocusAnimation() {
735 function playFocusAnimation() {
736− if (state == "sidestagedrightedge") {
736+ print("playing focus animation", state, root.mode, "app", model.application.appId)
737+ if (state == "stagedrightedge") {
737 // TODO: Can we drop this if and find something that always works?
738 // TODO: Can we drop this if and find something that always works?
738 if (root.mode == "staged") {
739 if (root.mode == "staged") {
739 rightEdgeFocusAnimation.targetX = 0
740 rightEdgeFocusAnimation.targetX = 0
741+ print("doing it to 0")
740 rightEdgeFocusAnimation.start()
742 rightEdgeFocusAnimation.start()
741 } else if (root.mode == "stagedWithSideStage") {
743 } 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
743 rightEdgeFocusAnimation.start()
745 rightEdgeFocusAnimation.start()
744 }
746 }
745 } else {
747 } 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.