@@ -18,9 +18,8 @@ import QtQuick 2.0
18import Ubuntu.Application 0.1
18import Ubuntu.Application 0.1
19import Ubuntu.Components 0.1
19import Ubuntu.Components 0.1
20import Ubuntu.Gestures 0.1
20import Ubuntu.Gestures 0.1
21−import LightDM 0.1 as LightDM
21+import SessionManager 0.1
22import "Dash"
22import "Dash"
24import "Launcher"
23import "Launcher"
25import "Panel"
24import "Panel"
26import "Hud"
25import "Hud"
@@ -31,17 +30,9 @@ import "SideStage"
31import "Notifications"
30import "Notifications"
32import Unity.Notifications 1.0 as NotificationBackend
31import Unity.Notifications 1.0 as NotificationBackend
34−FocusScope {
33+BasicShell {
37− // this is only here to select the width / height of the window if not running fullscreen
38− property bool tablet: false
39− width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
40− height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
42− property real edgeSize: units.gu(2)
43− property url default_background: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
44− property url background: default_background
45 readonly property real panelHeight: panel.panelHeight
36 readonly property real panelHeight: panel.panelHeight
47 property bool dashShown: dash.shown
38 property bool dashShown: dash.shown
@@ -72,9 +63,7 @@ FocusScope {
74 readonly property bool fullscreenMode: {
65 readonly property bool fullscreenMode: {
75− if (greeter.shown || lockscreen.shown) {
77− } else if (mainStage.usingScreenshots) { // Window Manager animating so want to re-evaluate fullscreen mode
66+ if (mainStage.usingScreenshots) { // Window Manager animating so want to re-evaluate fullscreen mode
78 return mainStage.switchingFromFullscreenToFullscreen;
67 return mainStage.switchingFromFullscreenToFullscreen;
79 } else if (applicationManager.mainStageFocusedApplication) {
68 } else if (applicationManager.mainStageFocusedApplication) {
80 return applicationManager.mainStageFocusedApplication.fullscreen;
69 return applicationManager.mainStageFocusedApplication.fullscreen;
@@ -87,9 +76,6 @@ FocusScope {
87 target: applicationManager
76 target: applicationManager
88 ignoreUnknownSignals: true
77 ignoreUnknownSignals: true
89 onFocusRequested: {
78 onFocusRequested: {
90− // TODO: this should be protected to only unlock for certain applications / certain usecases
91− // potentially only in connection with a notification
93 shell.activateApplication(desktopFile);
79 shell.activateApplication(desktopFile);
@@ -114,16 +100,9 @@ FocusScope {
121− Keys.onVolumeUpPressed: volumeControl.volumeUp()
122− Keys.onVolumeDownPressed: volumeControl.volumeDown()
124 Keys.onReleased: {
103 Keys.onReleased: {
125 if (event.key == Qt.Key_PowerOff) {
104 if (event.key == Qt.Key_PowerOff) {
126− greeter.show()
105+ SessionManager.lock()
@@ -162,7 +141,6 @@ FocusScope {
163 objectName: "dash"
142 objectName: "dash"
165− available: !greeter.shown && !lockscreen.shown
166 hides: [stages, launcher, panel.indicators]
144 hides: [stages, launcher, panel.indicators]
167 shown: disappearingAnimationProgress !== 1.0
145 shown: disappearingAnimationProgress !== 1.0
168 enabled: disappearingAnimationProgress === 0.0
146 enabled: disappearingAnimationProgress === 0.0
@@ -180,16 +158,10 @@ FocusScope {
181 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
159 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
182 opacity: 1.0 - disappearingAnimationProgress
160 opacity: 1.0 - disappearingAnimationProgress
183− property real disappearingAnimationProgress: {
161+ property real disappearingAnimationProgress: stagesOuterContainer.showProgress
184− if (greeter.shown) {
185− return greeter.showProgress;
187− return stagesOuterContainer.showProgress;
191− // FIXME: only necessary because stagesOuterContainer.showProgress and
163+ // FIXME: only necessary because stagesOuterContainer.showProgress
192− // greeterRevealer.animatedProgress are not animated
164+ // is not animated
193 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
165 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
@@ -214,7 +186,6 @@ FocusScope {
215 property bool fullyShown: shown && x == 0 && parent.x == 0
187 property bool fullyShown: shown && x == 0 && parent.x == 0
216 property bool fullyHidden: !shown && x == width
188 property bool fullyHidden: !shown && x == width
217− available: !greeter.shown
218 hides: [launcher, panel.indicators]
189 hides: [launcher, panel.indicators]
219 shown: false
190 shown: false
220 opacity: 1.0
191 opacity: 1.0
@@ -317,7 +288,7 @@ FocusScope {
317 && sideStage[sideStageRevealer.boundProperty] == sideStageRevealer.openedValue
288 && sideStage[sideStageRevealer.boundProperty] == sideStageRevealer.openedValue
318 shouldUseScreenshots: !fullyShown || mainStage.usingScreenshots || sideStageRevealer.pressed
289 shouldUseScreenshots: !fullyShown || mainStage.usingScreenshots || sideStageRevealer.pressed
320− available: !greeter.shown && !lockscreen.shown && enabled
291+ available: enabled
321 hides: [launcher, panel.indicators]
292 hides: [launcher, panel.indicators]
322 shown: false
293 shown: false
323 showAnimation: StandardAnimation { property: "x"; duration: 350; to: sideStageRevealer.openedValue; easing.type: Easing.OutQuint }
294 showAnimation: StandardAnimation { property: "x"; duration: 350; to: sideStageRevealer.openedValue; easing.type: Easing.OutQuint }
@@ -367,106 +338,6 @@ FocusScope {
372− hides: [launcher, panel.indicators, hud]
375− showAnimation: StandardAnimation { property: "opacity"; to: 1 }
376− hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
377− y: panel.panelHeight
378− x: required ? 0 : - width
380− height: parent.height - panel.panelHeight
381− background: shell.background
383− onUnlocked: lockscreen.hide()
384− onCancel: greeter.show()
386− Component.onCompleted: {
387− if (LightDM.Users.count == 1) {
388− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
394− target: LightDM.Greeter
397− if (LightDM.Users.count == 1) {
398− // TODO: There's no better way for now to determine if its a PIN or a passphrase.
399− if (text == "PIN") {
400− lockscreen.alphaNumeric = false
402− lockscreen.alphaNumeric = true
404− lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
414− hides: [launcher, panel.indicators, hud]
417− y: panel.panelHeight
419− height: parent.height - panel.panelHeight
421− dragHandleWidth: shell.edgeSize
423− property var previousMainApp: null
424− property var previousSideApp: null
429− // If there is only one user, we start authenticating with that one here.
430− // If there are more users, the Greeter will handle that
431− if (LightDM.Users.count == 1) {
432− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
434− greeter.forceActiveFocus();
435− // FIXME: *FocusedApplication are not updated when unfocused, hence the need to check whether
436− // the stage was actually shown
437− if (mainStage.fullyShown) greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
438− if (sideStage.fullyShown) greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
439− applicationManager.unfocusCurrentApplication();
441− if (greeter.previousMainApp) {
442− applicationManager.focusApplication(greeter.previousMainApp);
443− greeter.previousMainApp = null;
445− if (greeter.previousSideApp) {
446− applicationManager.focusApplication(greeter.previousSideApp);
447− greeter.previousSideApp = null;
452− onUnlocked: greeter.hide()
454− var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
455− shell.background = bgPath ? bgPath : default_background
458− onLeftTeaserPressedChanged: {
459− if (leftTeaserPressed) {
466− anchors.fill: parent
467− blockInput: greeter.shown || lockscreen.shown
471 id: overlay
342 id: overlay
@@ -480,7 +351,6 @@ FocusScope {
480 hides: [launcher]
351 hides: [launcher]
482 fullscreenMode: shell.fullscreenMode
353 fullscreenMode: shell.fullscreenMode
483− searchVisible: !greeter.shown && !lockscreen.shown
485 InputFilterArea {
355 InputFilterArea {
486 anchors.fill: parent
356 anchors.fill: parent
@@ -494,7 +364,7 @@ FocusScope {
494 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
364 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
495 height: parent.height
365 height: parent.height
497− available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown
367+ available: !panel.indicators.shown
498 shown: false
368 shown: false
499 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
369 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
500 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
370 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
@@ -552,9 +422,7 @@ FocusScope {
552 anchors.bottom: parent.bottom
422 anchors.bottom: parent.bottom
553 width: parent.width
423 width: parent.width
554 dragAreaWidth: shell.edgeSize
424 dragAreaWidth: shell.edgeSize
555− available: !greeter.locked
556 onDashItemSelected: {
425 onDashItemSelected: {
558 // Animate if moving between application and dash
426 // Animate if moving between application and dash
559 if (!stages.shown) {
427 if (!stages.shown) {
560 dash.setCurrentScope("home.scope", true, false)
428 dash.setCurrentScope("home.scope", true, false)
@@ -571,7 +439,6 @@ FocusScope {
573 onLauncherApplicationSelected:{
441 onLauncherApplicationSelected:{
575 shell.activateApplication(desktopFile)
442 shell.activateApplication(desktopFile)
577 onShownChanged: {
444 onShownChanged: {
@@ -622,16 +489,6 @@ FocusScope {
622 blockInput: true
489 blockInput: true
628− bottom: parent.bottom
631− width: shell.edgeSize
635 Binding {
492 Binding {
636 target: i18n
493 target: i18n
637 property: "domain"
494 property: "domain"