on xenial help sign in
Add bottom edge; some cleanup
commit144e568937cb9089e0d2367973f5bc64eedff7c8 authorMichael Terry <michael.terry@canonical.com> dateThu 24 Sep 2015, 13:49 (11 years ago) parent4af808d
9 files changed+103−48
qml/Greeter/Greeter.qml+1−1 qml/Launcher/Launcher.qml+2−3 qml/Panel/IndicatorsMenu.qml−2 qml/Shell.qml+5−31 qml/Stages/ApplicationWindow.qml−2 qml/Stages/PhoneStage.qml+1−4 qml/Tutorial/Tutorial.qml+20−3 qml/Tutorial/TutorialBottom.qml+46 qml/Tutorial/TutorialContent.qml+28−2
qml/Greeter/Greeter.qml+1−1
@@ -162,7 +162,7 @@ Showable {
162162 }
163163
164164 function checkForcedUnlock() {
165− if (forcedUnlock && shown) {
165+ if (forcedUnlock && shown && loader.item) {
166166 // pretend we were just authenticated
167167 loader.item.hide();
168168 loader.item.notifyAuthenticationSucceeded();
qml/Launcher/Launcher.qml+2−3
@@ -26,7 +26,6 @@ Item {
2626 property bool autohideEnabled: false
2727 property bool available: true // can be used to disable all interactions
2828 property alias inverted: panel.inverted
29− property bool shadeBackground: true // can be used to disable background shade when launcher is visible
3029
3130 property int panelWidth: units.gu(8)
3231 property int dragAreaWidth: units.gu(1)
@@ -187,7 +186,7 @@ Item {
187186 right: parent.right
188187 bottom: parent.bottom
189188 }
190− enabled: root.shadeBackground && root.state == "visible"
189+ enabled: root.state == "visible"
191190 onPressed: {
192191 root.state = ""
193192 }
@@ -197,7 +196,7 @@ Item {
197196 id: backgroundShade
198197 anchors.fill: parent
199198 color: "black"
200− opacity: root.shadeBackground && root.state == "visible" ? 0.6 : 0
199+ opacity: root.state == "visible" ? 0.6 : 0
201200
202201 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }
203202 }
qml/Panel/IndicatorsMenu.qml−2
@@ -36,7 +36,6 @@ Showable {
3636 readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0
3737 readonly property bool fullyClosed: unitProgress == 0
3838 property bool enableHint: true
39− property bool contentEnabled: true
4039 property bool showOnClick: true
4140 property color panelColor: "black"
4241
@@ -85,7 +84,6 @@ Showable {
8584 height: openedHeight - bar.height - handle.height
8685 indicatorsModel: root.indicatorsModel
8786 visible: root.unitProgress > 0
88− enabled: contentEnabled
8987 currentMenuIndex: bar.currentItemIndex
9088 }
9189
qml/Shell.qml+5−31
@@ -221,7 +221,7 @@ Item {
221221 onFocusedApplicationIdChanged: {
222222 var appId = ApplicationManager.focusedApplicationId;
223223
224− if (tutorial.running && appId != "" && appId != "unity8-dash") {
224+ if (wizard.active && appId != "" && appId != "unity8-dash") {
225225 // If this happens on first boot, we may be in edge
226226 // tutorial or wizard while receiving a call. But a call
227227 // is more important than wizard so just bail out of those.
@@ -406,7 +406,7 @@ Item {
406406 hides: [launcher, panel.indicators]
407407 tabletMode: shell.usageScenario != "phone"
408408 launcherOffset: launcher.progress
409− forcedUnlock: tutorial.running
409+ forcedUnlock: wizard.active
410410 background: shell.background
411411
412412 // avoid overlapping with Launcher's edge drag area
@@ -419,12 +419,6 @@ Item {
419419 launcher.hide();
420420 }
421421
422− onTease: {
423− if (!tutorial.running) {
424− launcher.tease();
425− }
426− }
427−
428422 onEmergencyCall: startLockedApp("dialer-app")
429423 }
430424 }
@@ -479,10 +473,6 @@ Item {
479473 }
480474
481475 function showHome() {
482− if (tutorial.running) {
483− return
484− }
485−
486476 greeter.notifyAboutToFocusApp("unity8-dash");
487477
488478 var animate = !lightDM.greeter.active && !stages.shown
@@ -516,7 +506,6 @@ Item {
516506 available: tutorial.panelEnabled
517507 && ((!greeter || !greeter.locked) || AccountsService.enableIndicatorsWhileLocked)
518508 && (!greeter || !greeter.hasLockedApp)
519− contentEnabled: tutorial.panelContentEnabled
520509 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
521510
522511 minimizedPanelHeight: units.gu(3)
@@ -556,7 +545,6 @@ Item {
556545 && (!greeter.locked || AccountsService.enableLauncherWhileLocked)
557546 && !greeter.hasLockedApp
558547 inverted: shell.usageScenario !== "desktop"
559− shadeBackground: !tutorial.running
560548
561549 onShowDashHome: showHome()
562550 onDash: showDash()
@@ -566,10 +554,8 @@ Item {
566554 }
567555 }
568556 onLauncherApplicationSelected: {
569− if (!tutorial.running) {
570− greeter.notifyAboutToFocusApp(appId);
571− shell.activateApplication(appId)
572− }
557+ greeter.notifyAboutToFocusApp(appId);
558+ shell.activateApplication(appId);
573559 }
574560 onShownChanged: {
575561 if (shown) {
@@ -583,22 +569,10 @@ Item {
583569 objectName: "tutorial"
584570 anchors.fill: parent
585571
586− // EdgeDragAreas don't work with mice. So to avoid trapping the user,
587− // we skip the tutorial on the Desktop to avoid using them. The
588− // Desktop doesn't use the same spread design anyway. The tutorial is
589− // all a bit of a placeholder on non-phone form factors right now.
590− // When the design team gives us more guidance, we can do something
591− // more clever here.
592− active: usageScenario != "desktop" && AccountsService.demoEdges
593−
572+ usageScenario: usageScenario
594573 launcher: launcher
595574 panel: panel
596575 stage: applicationsDisplayLoader.item
597−
598− onFinished: {
599− AccountsService.demoEdges = false;
600− active = false; // for immediate response / if AS is having problems
601− }
602576 }
603577
604578 Wizard {
qml/Stages/ApplicationWindow.qml−2
@@ -44,7 +44,6 @@ FocusScope {
4444 readonly property color splashColor: root.application ? root.application.splashColor : "#00000000"
4545 readonly property color splashColorHeader: root.application ? root.application.splashColorHeader : "#00000000"
4646 readonly property color splashColorFooter: root.application ? root.application.splashColorFooter : "#00000000"
47− readonly property url defaultScreenshot: (root.application && root.application.defaultScreenshot !== undefined) ? root.application.defaultScreenshot : ""
4847
4948 // Whether the Application had a surface before but lost it.
5049 property bool hadSurface: sessionContainer.surfaceContainer.hadSurface
@@ -90,7 +89,6 @@ FocusScope {
9089 Image {
9190 id: screenshotImage
9291 objectName: "screenshotImage"
93− source: d.defaultScreenshot
9492 anchors.fill: parent
9593 antialiasing: !root.interactive
9694
qml/Stages/PhoneStage.qml+1−4
@@ -105,9 +105,6 @@ Rectangle {
105105
106106 readonly property alias dragging: spreadDragArea.dragging
107107
108− // Only used by the tutorial right now, when it is teasing the right edge
109− property real dragAreaOverlap
110−
111108 signal opened()
112109
113110 color: "#111111"
@@ -586,7 +583,7 @@ Rectangle {
586583 direction: Direction.Leftwards
587584 enabled: (spreadView.phase != 2 && root.spreadEnabled) || dragging
588585
589− anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.dragAreaOverlap }
586+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom; }
590587 width: root.dragAreaWidth
591588
592589 property var gesturePoints: new Array()
qml/Tutorial/Tutorial.qml+20−3
@@ -16,6 +16,12 @@
1616
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
19+import AccountsService 0.1
20+
21+/**
22+ * This object is always present, so it should be lean and mean. It will
23+ * use a Loader to create the heavier tutorial pages if needed.
24+ */
1925
2026Item {
2127 id: root
@@ -25,11 +31,11 @@ Item {
2531 property Item launcher
2632 property Item panel
2733 property Item stage
34+ property string usageScenario
2835
2936 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
3037 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
3138 readonly property bool panelEnabled: loader.item ? loader.item.panelEnabled : true
32− readonly property bool panelContentEnabled: loader.item ? loader.item.panelContentEnabled : true
3339 readonly property bool running: loader.item ? loader.item.running : false
3440
3541 function finish() {
@@ -38,13 +44,24 @@ Item {
3844 }
3945 }
4046
41− signal finished()
47+ Connections {
48+ target: panel.indicators
49+ onFullyOpenedChanged: AccountsService.markDemoEdgeCompleted("top")
50+ }
4251
4352 Loader {
4453 id: loader
4554 anchors.fill: parent
4655 source: "TutorialContent.qml"
4756
57+ // EdgeDragAreas don't work with mice. So to avoid trapping the user,
58+ // we skip the tutorial on the Desktop to avoid using them. The
59+ // Desktop doesn't use the same spread design anyway. The tutorial is
60+ // all a bit of a placeholder on non-phone form factors right now.
61+ // When the design team gives us more guidance, we can do something
62+ // more clever here.
63+ active: usageScenario != "desktop" && AccountsService.demoEdges
64+
4865 Binding {
4966 target: loader.item
5067 property: "launcher"
@@ -65,7 +82,7 @@ Item {
6582
6683 Connections {
6784 target: loader.item
68− onFinished: root.finished()
85+ onFinished: AccountsService.demoEdges = false
6986 }
7087 }
7188}
qml/Tutorial/TutorialBottom.qmlnew file+46
@@ -0,0 +1,46 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import "." as LocalComponents
20+
21+TutorialPage {
22+ id: root
23+
24+ background {
25+ sourceSize.height: 1080
26+ sourceSize.width: 1916
27+ source: Qt.resolvedUrl("graphics/background2.png")
28+ rotation: 180
29+ }
30+
31+ arrow {
32+ anchors.bottom: root.bottom
33+ anchors.bottomMargin: units.gu(4)
34+ anchors.horizontalCenter: root.horizontalCenter
35+ rotation: -90
36+ }
37+
38+ label {
39+ text: i18n.tr("Swipe from the bottom edge")
40+ anchors.bottom: arrow.top
41+ anchors.bottomMargin: units.gu(3)
42+ anchors.horizontalCenter: root.horizontalCenter
43+ anchors.horizontalCenterOffset: (label.width - label.contentWidth) / 2
44+ width: root.width - units.gu(8)
45+ }
46+}
qml/Tutorial/TutorialContent.qml+28−2
@@ -28,7 +28,6 @@ Item {
2828 readonly property bool launcherEnabled: !running || tutorialLeft.shown
2929 readonly property bool spreadEnabled: !running || tutorialRight.shown
3030 readonly property bool panelEnabled: !running || tutorialTop.shown
31− readonly property bool panelContentEnabled: !running
3231 readonly property alias running: d.running
3332
3433 signal finished()
@@ -42,7 +41,7 @@ Item {
4241 QtObject {
4342 id: d
4443
45− property bool running: tutorialLeft.shown || tutorialTop.shown || tutorialRight.shown
44+ property bool running: tutorialLeft.shown || tutorialTop.shown || tutorialRight.shown || tutorialBottom.shown
4645 }
4746
4847 TutorialLeft {
@@ -116,6 +115,33 @@ Item {
116115
117116 onFinished: {
118117 AccountsService.markDemoEdgeCompleted("right");
118+ }
119+ }
120+
121+ TutorialBottom {
122+ id: tutorialBottom
123+ objectName: "tutorialBottom"
124+ anchors.fill: parent
125+ hides: [launcher, panel.indicators]
126+
127+ Connections {
128+ target: AccountsService
129+ onDemoEdgesCompletedChanged: {
130+ if (AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
131+ AccountsService.demoEdgesCompleted.indexOf("bottom") == -1) {
132+ tutorialBottomTimer.start();
133+ }
134+ }
135+ }
136+
137+ Timer {
138+ id: tutorialBottomTimer
139+ interval: 1
140+ onTriggered: tutorialBottom.show()
141+ }
142+
143+ onFinished: {
144+ AccountsService.markDemoEdgeCompleted("bottom");
119145 root.finish();
120146 }
121147 }