@@ -20,7 +20,6 @@ import Ubuntu.Application 0.1
20import Ubuntu.Components 0.1
20import Ubuntu.Components 0.1
21import Ubuntu.Gestures 0.1
21import Ubuntu.Gestures 0.1
22import LightDM 0.1 as LightDM
22import LightDM 0.1 as LightDM
23−import AccountsService 0.1
24import Powerd 0.1
23import Powerd 0.1
25import "Dash"
24import "Dash"
26import "Greeter"
25import "Greeter"
@@ -60,20 +59,6 @@ FocusScope {
63− property bool showEdgeDemo: false
64− property bool showEdgeDemoInGreeter: showEdgeDemo // TODO: AccountsService.getUserProperty("lightdm", "demo-edges")
66− function hideEdgeDemo() {
67− var user = LightDM.Users.data(greeter.currentIndex, LightDM.UserRoles.NameRole);
68− AccountsService.setUserProperty(user, "demo-edges", false);
69− shell.showEdgeDemo = false;
72− function hideEdgeDemoInGreeter() {
73− // TODO: AccountsService.setUserProperty("lightdm", "demo-edges", false);
74− shell.showEdgeDemoInGreeter = false;
77 property ListModel searchHistory: SearchHistoryModel {}
62 property ListModel searchHistory: SearchHistoryModel {}
79 property var applicationManager: ApplicationManagerWrapper {}
64 property var applicationManager: ApplicationManagerWrapper {}
@@ -206,7 +191,7 @@ FocusScope {
206 available: !greeter.shown && !lockscreen.shown
191 available: !greeter.shown && !lockscreen.shown
207 hides: [stages, launcher, panel.indicators]
192 hides: [stages, launcher, panel.indicators]
208 shown: disappearingAnimationProgress !== 1.0
193 shown: disappearingAnimationProgress !== 1.0
209− enabled: disappearingAnimationProgress === 0.0 && !leftEdgeDemo.active && !topEdgeDemo.active && !finalEdgeDemo.active
194+ enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
210 // FIXME: unfocus all applications when going back to the dash
195 // FIXME: unfocus all applications when going back to the dash
211 onEnabledChanged: {
196 onEnabledChanged: {
212 if (enabled) {
197 if (enabled) {
@@ -233,50 +218,6 @@ FocusScope {
233 // greeterRevealer.animatedProgress are not animated
218 // greeterRevealer.animatedProgress are not animated
234 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
219 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
241− title: i18n.tr("Top edge")
242− text: i18n.tr("Try swiping from the top edge to access the indicators")
245− available: shell.showEdgeDemo
246− onSkip: shell.hideEdgeDemo()
250− onShownChanged: if (!greeter.shown) topEdgeDemo.show()
254− target: panel.indicators
255− onFullyOpenedChanged: if (panel.indicators.fullyOpened) topEdgeDemo.hideNow()
263− title: i18n.tr("Left edge")
264− text: i18n.tr("Swipe from the left to reveal the launcher for quick access to apps")
267− available: shell.showEdgeDemo
268− onSkip: shell.hideEdgeDemo()
271− target: bottomEdgeDemo
272− onActiveChanged: if (!bottomEdgeDemo.active) leftEdgeDemo.show()
277− onStateChanged: if (launcher.state == "visible") leftEdgeDemo.hide()
@@ -519,45 +460,12 @@ FocusScope {
521 onUnlocked: greeter.hide()
462 onUnlocked: greeter.hide()
523− // Update edge demo hint
524− var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole)
525− shell.showEdgeDemo = AccountsService.getUserProperty(user, "demo-edges")
528 onLeftTeaserPressedChanged: {
464 onLeftTeaserPressedChanged: {
529 if (leftTeaserPressed) {
465 if (leftTeaserPressed) {
530 launcher.tease();
466 launcher.tease();
538− title: i18n.tr("Right edge")
539− text: i18n.tr("Try swiping from the right edge to unlock the phone")
540− anchors.fill: parent
541− visible: shell.showEdgeDemoInGreeter
543− shell.hideEdgeDemoInGreeter()
544− shell.hideEdgeDemo()
551− if (rightEdgeDemo.active) {
552− rightEdgeDemo.hide()
553− shell.hideEdgeDemoInGreeter()
558− onShownChanged: if (!greeter.shown) hide()
563 InputFilterArea {
471 InputFilterArea {
@@ -614,7 +522,7 @@ FocusScope {
614 indicatorsMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
522 indicatorsMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
615 indicators {
523 indicators {
616 hides: [launcher]
524 hides: [launcher]
617− available: !rightEdgeDemo.active && !leftEdgeDemo.active && !finalEdgeDemo.active
525+ available: edgeDemo.panelEnabled
619 fullscreenMode: shell.fullscreenMode
527 fullscreenMode: shell.fullscreenMode
620 searchVisible: !greeter.shown && !lockscreen.shown
528 searchVisible: !greeter.shown && !lockscreen.shown
@@ -623,24 +531,6 @@ FocusScope {
623 anchors.fill: parent
531 anchors.fill: parent
624 blockInput: panel.indicators.shown
532 blockInput: panel.indicators.shown
631− title: i18n.tr("Close")
632− text: i18n.tr("Swipe up again to close the settings screen")
633− anchors.fill: panel.indicators
635− available: shell.showEdgeDemo
636− onSkip: shell.hideEdgeDemo()
639− target: panel.indicators
640− onFullyOpenedChanged: if (panel.indicators.fullyOpened) bottomEdgeDemo.show()
641− onPartiallyOpenedChanged: if (!panel.indicators.partiallyOpened && !panel.indicators.fullyOpened) bottomEdgeDemo.hideNow()
@@ -649,7 +539,7 @@ FocusScope {
649 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
539 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
650 height: parent.height
540 height: parent.height
652− available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown && !topEdgeDemo.active
542+ available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown && edgeDemo.dashEnabled
653 shown: false
543 shown: false
654 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
544 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
655 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
545 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
@@ -707,7 +597,7 @@ FocusScope {
707 anchors.bottom: parent.bottom
597 anchors.bottom: parent.bottom
708 width: parent.width
598 width: parent.width
709 dragAreaWidth: shell.edgeSize
599 dragAreaWidth: shell.edgeSize
710− available: (!greeter.shown || greeter.narrowMode) && !rightEdgeDemo.active && !topEdgeDemo.active && !bottomEdgeDemo.active && !finalEdgeDemo.active
600+ available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
711 onDashItemSelected: {
601 onDashItemSelected: {
712 greeter.hide()
602 greeter.hide()
713 // Animate if moving between application and dash
603 // Animate if moving between application and dash
@@ -765,29 +655,6 @@ FocusScope {
772− title: i18n.tr("Well done")
773− text: i18n.tr("You have now mastered the edge gestures and can start using the phone")
774− skipText: i18n.tr("Finish")
775− anchors.fill: overlay
777− available: shell.showEdgeDemo
778− onSkip: shell.hideEdgeDemo()
781− target: leftEdgeDemo
783− if (leftEdgeDemo.active && !leftEdgeDemo.shown) {
784− finalEdgeDemo.show();
791 focus: true
658 focus: true
793 InputFilterArea {
660 InputFilterArea {
@@ -839,4 +706,13 @@ FocusScope {
839 rotation: -45
706 rotation: -45
840 scale: Math.min(parent.width, parent.height) / width
707 scale: Math.min(parent.width, parent.height) / width
715+ indicators: panel.indicators