on xenial help sign in
Show top hint at upper right if in landscape mode
commit134dd5042215aecc05532c1a4e6bb0dfeb9ec0a2 authorMichael Terry <michael.terry@canonical.com> dateWed 14 Oct 2015, 11:57 (11 years ago) parentbb6e493
2 files changed+40−40
qml/Tutorial/TutorialContent.qml+27−35 qml/Tutorial/TutorialTop.qml+13−5
qml/Tutorial/TutorialContent.qml+27−35
@@ -49,11 +49,9 @@ Item {
4949 launcher: root.launcher
5050 hides: [launcher, panel.indicators]
5151
52− function isReady() {
53− return AccountsService.demoEdgesCompleted.indexOf("left") == -1;
54− }
52+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") == -1
5553
56− Component.onCompleted: if (tutorialLeft.isReady()) show()
54+ Component.onCompleted: if (tutorialLeft.isReady) show()
5755 onFinished: AccountsService.markDemoEdgeCompleted("left")
5856 }
5957
@@ -64,23 +62,21 @@ Item {
6462 panel: root.panel
6563 hides: [launcher, panel.indicators]
6664
67− function isReady() {
68− return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
69− AccountsService.demoEdgesCompleted.indexOf("top") == -1;
70− }
65+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
66+ AccountsService.demoEdgesCompleted.indexOf("top") == -1
7167
7268 Timer {
7369 id: tutorialTopTimer
7470 interval: 60000
75− onTriggered: if (tutorialTop.isReady()) tutorialTop.show()
71+ onTriggered: if (tutorialTop.isReady) tutorialTop.show()
7672 }
7773
7874 Connections {
7975 target: AccountsService
80− onDemoEdgesCompletedChanged: if (tutorialTop.isReady()) tutorialTopTimer.start()
76+ onDemoEdgesCompletedChanged: if (tutorialTop.isReady) tutorialTopTimer.start()
8177 }
8278
83− Component.onCompleted: if (tutorialTop.isReady()) tutorialTopTimer.start()
79+ Component.onCompleted: if (tutorialTop.isReady) tutorialTopTimer.start()
8480 onFinished: AccountsService.markDemoEdgeCompleted("top")
8581
8682 Connections {
@@ -100,27 +96,25 @@ Item {
10096 stage: root.stage
10197 hides: [launcher, panel.indicators]
10298
103− function isReady() {
104− return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
105− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
106− AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
107− ApplicationManager.count >= 3;
108− }
99+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
100+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
101+ AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
102+ ApplicationManager.count >= 3
109103
110104 Timer {
111105 id: tutorialRightTimer
112106 interval: 3000
113− onTriggered: if (tutorialRight.isReady()) tutorialRight.show()
107+ onTriggered: if (tutorialRight.isReady) tutorialRight.show()
114108 }
115109
116110 Connections {
117111 target: AccountsService
118− onDemoEdgesCompletedChanged: if (tutorialRight.isReady()) tutorialRightTimer.start()
112+ onDemoEdgesCompletedChanged: if (tutorialRight.isReady) tutorialRightTimer.start()
119113 }
120114
121115 Connections {
122116 target: ApplicationManager
123− onApplicationAdded: if (tutorialRight.isReady()) tutorialRight.show()
117+ onApplicationAdded: if (tutorialRight.isReady) tutorialRight.show()
124118 }
125119
126120 onFinished: AccountsService.markDemoEdgeCompleted("right")
@@ -141,33 +135,31 @@ Item {
141135 anchors.fill: parent
142136 hides: [launcher, panel.indicators]
143137
144− function isReady() {
145− return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
146− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
147− AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
148− AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
149− // focused app is an app known to have a bottom edge
150− (ApplicationManager.focusedApplicationId == "dialer-app" ||
151− ApplicationManager.focusedApplicationId == "webbrowser-app" ||
152− ApplicationManager.focusedApplicationId == "messaging-app" ||
153− ApplicationManager.focusedApplicationId == "camera-app" ||
154− ApplicationManager.focusedApplicationId == "clock-app");
155− }
138+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
139+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
140+ AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
141+ AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
142+ // focused app is an app known to have a bottom edge
143+ (ApplicationManager.focusedApplicationId == "dialer-app" ||
144+ ApplicationManager.focusedApplicationId == "webbrowser-app" ||
145+ ApplicationManager.focusedApplicationId == "messaging-app" ||
146+ ApplicationManager.focusedApplicationId == "camera-app" ||
147+ ApplicationManager.focusedApplicationId == "clock-app")
156148
157149 Timer {
158150 id: tutorialBottomTimer
159151 interval: 3000
160− onTriggered: if (tutorialBottom.isReady()) tutorialBottom.show()
152+ onTriggered: if (tutorialBottom.isReady) tutorialBottom.show()
161153 }
162154
163155 Connections {
164156 target: AccountsService
165− onDemoEdgesCompletedChanged: if (tutorialBottom.isReady()) tutorialBottomTimer.start()
157+ onDemoEdgesCompletedChanged: if (tutorialBottom.isReady) tutorialBottomTimer.start()
166158 }
167159
168160 Connections {
169161 target: ApplicationManager
170− onFocusedApplicationIdChanged: if (tutorialBottom.isReady()) tutorialBottom.show()
162+ onFocusedApplicationIdChanged: if (tutorialBottom.isReady) tutorialBottom.show()
171163 }
172164
173165 onFinished: {
qml/Tutorial/TutorialTop.qml+13−5
@@ -25,6 +25,12 @@ TutorialPage {
2525
2626 opacityOverride: 1 - panel.indicators.unitProgress
2727
28+ QtObject {
29+ id: d
30+ readonly property bool landscape: root.width > units.gu(50)
31+ readonly property real columnWidth: landscape ? panel.indicators.width : root.width
32+ }
33+
2834 mouseArea {
2935 anchors.topMargin: panel.indicators.minimizedPanelHeight
3036 }
@@ -38,16 +44,18 @@ TutorialPage {
3844 arrow {
3945 anchors.top: root.top
4046 anchors.topMargin: units.gu(4)
41− anchors.horizontalCenter: root.horizontalCenter
47+ anchors.horizontalCenter: root.right
48+ anchors.horizontalCenterOffset: - d.columnWidth / 2
4249 rotation: 90
4350 }
4451
4552 label {
46− text: i18n.tr("Swipe from the top edge to open the notification bar")
53+ text: d.landscape ? i18n.tr("Swipe from the top right edge to open the notification bar")
54+ : i18n.tr("Swipe from the top edge to open the notification bar")
4755 anchors.top: arrow.bottom
4856 anchors.topMargin: units.gu(3)
49− anchors.horizontalCenter: root.horizontalCenter
50− anchors.horizontalCenterOffset: (label.width - label.contentWidth) / 2
51− width: root.width - units.gu(8)
57+ anchors.horizontalCenter: arrow.horizontalCenter
58+ anchors.horizontalCenterOffset: (width - contentWidth) / 2
59+ width: d.columnWidth - units.gu(8)
5260 }
5361}