@@ -56,11 +56,13 @@ FocusScope {
56 if (ApplicationManager.findApplication(appId)) {
56 if (ApplicationManager.findApplication(appId)) {
57 print("Shell.qml: activating app", appId);
57 print("Shell.qml: activating app", appId);
58 ApplicationManager.activateApplication(appId);
58 ApplicationManager.activateApplication(appId);
60 print("starting app", appId);
61 print("starting app", appId);
62 var execFlags = shell.sideStageEnabled ? ApplicationManager.NoFlag : ApplicationManager.ForceMainStage;
63 var execFlags = shell.sideStageEnabled ? ApplicationManager.NoFlag : ApplicationManager.ForceMainStage;
63 ApplicationManager.startApplication(appId, execFlags);
64 ApplicationManager.startApplication(appId, execFlags);
@@ -122,7 +124,7 @@ FocusScope {
122 readonly property bool applicationRunning: ApplicationManager.focusedApplicationId.length > 0
124 readonly property bool applicationRunning: ApplicationManager.focusedApplicationId.length > 0
124 // Whether the user should see the topmost application surface (if there's one at all).
126 // Whether the user should see the topmost application surface (if there's one at all).
125− readonly property bool applicationSurfaceShouldBeSeen: applicationRunning && !stages.painting
127+ readonly property bool applicationSurfaceShouldBeSeen: stages.shown && !stages.painting
127 // NB! Application surfaces are stacked behind the shell one. So they can only be seen by the user
129 // NB! Application surfaces are stacked behind the shell one. So they can only be seen by the user
128 // through the translucent parts of the shell surface.
130 // through the translucent parts of the shell surface.
@@ -163,115 +165,111 @@ FocusScope {
163 if (greeter.shown) {
165 if (greeter.shown) {
164 return greeter.showProgress;
166 return greeter.showProgress;
166− return stagesOuterContainer.showProgress;
168+ return stages.showProgress;
170− // FIXME: only necessary because stagesOuterContainer.showProgress and
172+ // FIXME: only necessary because stages.showProgress and
171 // greeterRevealer.animatedProgress are not animated
173 // greeterRevealer.animatedProgress are not animated
172 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
174 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
176− Item {
178+ EdgeDragArea {
177− id: stagesOuterContainer
179+ id: stagesDragHandle
180+ direction: Direction.LeftWards
182+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
183+ width: shell.edgeSize
185+ property real progress: stages.width
188+ if (status == DirectionalDragArea.Recognized) {
189+ if (ApplicationManager.count == 0) {
190+ progress = Math.max(stages.width + touchX * 2, stages.width * .7)
192+ progress = stages.width + touchX
197+ onDraggingChanged: {
199+ if (ApplicationManager.count > 0 && progress < stages.width - units.gu(10)) {
202+ stagesDragHandle.progress = stages.width;
209+ objectName: "stages"
179 width: parent.width
210 width: parent.width
180 height: parent.height
211 height: parent.height
181− x: launcher.progress
182− Behavior on x {SmoothedAnimation{velocity: 600}}
184− property real showProgress: MathUtils.clamp(1 - (x + stages.x) / shell.width, 0, 1)
213+ x: shown ? launcher.progress : stagesDragHandle.progress
186− Showable {
215+ Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.SlowDuration } }
188− objectName: "stages"
190− x: width
217+ property bool shown: false
192− property bool fullyShown: shown && x == 0 && parent.x == 0
219+ property real showProgress: MathUtils.clamp(1 - x / shell.width, 0, 1)
193− property bool fullyHidden: !shown && x == width
195− property bool painting: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.painting : false
221+ property bool fullyShown: x == 0
196− property bool fullscreen: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.fullscreen : false
222+ property bool fullyHidden: x == width
198− available: !greeter.shown
224+ property bool painting: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.painting : false
199− hides: [panel.indicators]
225+ property bool fullscreen: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.fullscreen : false
202− showAnimation: StandardAnimation { property: "x"; duration: 350; to: 0; easing.type: Easing.OutCubic }
203− hideAnimation: StandardAnimation { property: "x"; duration: 350; to: width; easing.type: Easing.OutCubic }
206− height: parent.height
208− property string lastFocusedAppId
227+ function show() {
209− onShownChanged: {
228+ shown = true;
210− print("stages shown", shown)
229+ panel.indicators.hide();
212− if (!ApplicationManager.focusedApplicationId && lastFocusedAppId) {
230+ if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0) {
213− ApplicationManager.focusApplication(lastFocusedAppId);
231+ ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
216− lastFocusedAppId = ApplicationManager.focusedApplicationId;
217− ApplicationManager.unfocusCurrentApplication();
221− Connections {
235+ function hide() {
222− target: ApplicationManager
236+ shown = false;
223− onFocusedApplicationIdChanged: {
237+ ApplicationManager.unfocusCurrentApplication();
224− if (ApplicationManager.focusedApplicationId.length > 0) {
225− print("should show stages")
232− onApplicationAdded: {
240+ Connections {
241+ target: ApplicationManager
242+ onFocusedApplicationIdChanged: {
243+ if (ApplicationManager.focusedApplicationId.length > 0) {
233 stages.show();
244 stages.show();
237− Loader {
248+ onApplicationAdded: {
238− id: applicationsDisplayLoader
239− anchors.fill: parent
241− source: shell.sideStageEnabled ? "Stages/StageWithSideStage.qml" : "Stages/PhoneStage.qml"
244− target: applicationsDisplayLoader.item
246− value: !stages.fullyShown
249− target: applicationsDisplayLoader.item
251− value: stages.shown
249+ stages.show();
254− target: applicationsDisplayLoader.item
255− property: "dragAreaWidth"
256− value: shell.edgeSize
260− DragHandle {
253+ Loader {
261− id: stagesDragHandle
254+ id: applicationsDisplayLoader
263− anchors.top: parent.top
264− anchors.bottom: parent.bottom
265− anchors.right: parent.left
255+ anchors.fill: parent
267− width: shell.edgeSize
257+ source: shell.sideStageEnabled ? "Stages/StageWithSideStage.qml" : "Stages/PhoneStage.qml"
268− direction: Direction.Leftwards
269− enabled: greeter.showProgress == 0 && edgeDemo.dashEnabled
270− property bool haveApps: ApplicationManager.count > 0
272− maxTotalDragDistance: haveApps ? parent.width : parent.width * 0.7
259+ Binding {
273− // Make autocompletion impossible when !haveApps
260+ target: applicationsDisplayLoader.item
274− edgeDragEvaluator.minDragDistance: haveApps ? maxTotalDragDistance * 0.1 : Number.MAX_VALUE
261+ property: "moving"
262+ value: !stages.fullyShown
265+ target: applicationsDisplayLoader.item
270+ target: applicationsDisplayLoader.item
271+ property: "dragAreaWidth"
272+ value: shell.edgeSize
@@ -433,8 +431,7 @@ FocusScope {
434 property string focusedAppId: ApplicationManager.focusedApplicationId
432 property string focusedAppId: ApplicationManager.focusedApplicationId
435 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
433 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
436− fullscreenMode: stages.painting ? stages.fullscreen :
437− focusedApplication && focusedApplication.fullscreen && !greeter.shown && !lockscreen.shown
434+ fullscreenMode: focusedApplication && stages.fullscreen && !greeter.shown && !lockscreen.shown
438 searchVisible: !greeter.shown && !lockscreen.shown && dash.shown
435 searchVisible: !greeter.shown && !lockscreen.shown && dash.shown
440 InputFilterArea {
437 InputFilterArea {