on xenial help sign in
Show top hint at upper right if in landscape mode
134dd50Michael Terry
qml/Tutorial/TutorialContent.qml+27−35
@@ -49,11 +49,9 @@ Item {
49 launcher: root.launcher
49 launcher: root.launcher
50 hides: [launcher, panel.indicators]
50 hides: [launcher, panel.indicators]
51
51
52− function isReady() {
53− return AccountsService.demoEdgesCompleted.indexOf("left") == -1;
52+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") == -1
54− }
55
53
56− Component.onCompleted: if (tutorialLeft.isReady()) show()
54+ Component.onCompleted: if (tutorialLeft.isReady) show()
57 onFinished: AccountsService.markDemoEdgeCompleted("left")
55 onFinished: AccountsService.markDemoEdgeCompleted("left")
58 }
56 }
59
57
@@ -64,23 +62,21 @@ Item {
64 panel: root.panel
62 panel: root.panel
65 hides: [launcher, panel.indicators]
63 hides: [launcher, panel.indicators]
66
64
67− function isReady() {
68− return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
65+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
69− AccountsService.demoEdgesCompleted.indexOf("top") == -1;
66+ AccountsService.demoEdgesCompleted.indexOf("top") == -1
70− }
71
67
72 Timer {
68 Timer {
73 id: tutorialTopTimer
69 id: tutorialTopTimer
74 interval: 60000
70 interval: 60000
75− onTriggered: if (tutorialTop.isReady()) tutorialTop.show()
71+ onTriggered: if (tutorialTop.isReady) tutorialTop.show()
76 }
72 }
77
73
78 Connections {
74 Connections {
79 target: AccountsService
75 target: AccountsService
80− onDemoEdgesCompletedChanged: if (tutorialTop.isReady()) tutorialTopTimer.start()
76+ onDemoEdgesCompletedChanged: if (tutorialTop.isReady) tutorialTopTimer.start()
81 }
77 }
82
78
83− Component.onCompleted: if (tutorialTop.isReady()) tutorialTopTimer.start()
79+ Component.onCompleted: if (tutorialTop.isReady) tutorialTopTimer.start()
84 onFinished: AccountsService.markDemoEdgeCompleted("top")
80 onFinished: AccountsService.markDemoEdgeCompleted("top")
85
81
86 Connections {
82 Connections {
@@ -100,27 +96,25 @@ Item {
100 stage: root.stage
96 stage: root.stage
101 hides: [launcher, panel.indicators]
97 hides: [launcher, panel.indicators]
102
98
103− function isReady() {
104− return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
99+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
105− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
100+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
106− AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
101+ AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
107− ApplicationManager.count >= 3;
102+ ApplicationManager.count >= 3
108− }
109
103
110 Timer {
104 Timer {
111 id: tutorialRightTimer
105 id: tutorialRightTimer
112 interval: 3000
106 interval: 3000
113− onTriggered: if (tutorialRight.isReady()) tutorialRight.show()
107+ onTriggered: if (tutorialRight.isReady) tutorialRight.show()
114 }
108 }
115
109
116 Connections {
110 Connections {
117 target: AccountsService
111 target: AccountsService
118− onDemoEdgesCompletedChanged: if (tutorialRight.isReady()) tutorialRightTimer.start()
112+ onDemoEdgesCompletedChanged: if (tutorialRight.isReady) tutorialRightTimer.start()
119 }
113 }
120
114
121 Connections {
115 Connections {
122 target: ApplicationManager
116 target: ApplicationManager
123− onApplicationAdded: if (tutorialRight.isReady()) tutorialRight.show()
117+ onApplicationAdded: if (tutorialRight.isReady) tutorialRight.show()
124 }
118 }
125
119
126 onFinished: AccountsService.markDemoEdgeCompleted("right")
120 onFinished: AccountsService.markDemoEdgeCompleted("right")
@@ -141,33 +135,31 @@ Item {
141 anchors.fill: parent
135 anchors.fill: parent
142 hides: [launcher, panel.indicators]
136 hides: [launcher, panel.indicators]
143
137
144− function isReady() {
145− return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
138+ readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
146− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
139+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
147− AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
140+ AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
148− AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
141+ AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
149− // focused app is an app known to have a bottom edge
142+ // focused app is an app known to have a bottom edge
150− (ApplicationManager.focusedApplicationId == "dialer-app" ||
143+ (ApplicationManager.focusedApplicationId == "dialer-app" ||
151− ApplicationManager.focusedApplicationId == "webbrowser-app" ||
144+ ApplicationManager.focusedApplicationId == "webbrowser-app" ||
152− ApplicationManager.focusedApplicationId == "messaging-app" ||
145+ ApplicationManager.focusedApplicationId == "messaging-app" ||
153− ApplicationManager.focusedApplicationId == "camera-app" ||
146+ ApplicationManager.focusedApplicationId == "camera-app" ||
154− ApplicationManager.focusedApplicationId == "clock-app");
147+ ApplicationManager.focusedApplicationId == "clock-app")
155− }
156
148
157 Timer {
149 Timer {
158 id: tutorialBottomTimer
150 id: tutorialBottomTimer
159 interval: 3000
151 interval: 3000
160− onTriggered: if (tutorialBottom.isReady()) tutorialBottom.show()
152+ onTriggered: if (tutorialBottom.isReady) tutorialBottom.show()
161 }
153 }
162
154
163 Connections {
155 Connections {
164 target: AccountsService
156 target: AccountsService
165− onDemoEdgesCompletedChanged: if (tutorialBottom.isReady()) tutorialBottomTimer.start()
157+ onDemoEdgesCompletedChanged: if (tutorialBottom.isReady) tutorialBottomTimer.start()
166 }
158 }
167
159
168 Connections {
160 Connections {
169 target: ApplicationManager
161 target: ApplicationManager
170− onFocusedApplicationIdChanged: if (tutorialBottom.isReady()) tutorialBottom.show()
162+ onFocusedApplicationIdChanged: if (tutorialBottom.isReady) tutorialBottom.show()
171 }
163 }
172
164
173 onFinished: {
165 onFinished: {
qml/Tutorial/TutorialTop.qml+13−5
@@ -25,6 +25,12 @@ TutorialPage {
25
25
26 opacityOverride: 1 - panel.indicators.unitProgress
26 opacityOverride: 1 - panel.indicators.unitProgress
27
27
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+
28 mouseArea {
34 mouseArea {
29 anchors.topMargin: panel.indicators.minimizedPanelHeight
35 anchors.topMargin: panel.indicators.minimizedPanelHeight
30 }
36 }
@@ -38,16 +44,18 @@ TutorialPage {
38 arrow {
44 arrow {
39 anchors.top: root.top
45 anchors.top: root.top
40 anchors.topMargin: units.gu(4)
46 anchors.topMargin: units.gu(4)
41− anchors.horizontalCenter: root.horizontalCenter
47+ anchors.horizontalCenter: root.right
48+ anchors.horizontalCenterOffset: - d.columnWidth / 2
42 rotation: 90
49 rotation: 90
43 }
50 }
44
51
45 label {
52 label {
53+ text: d.landscape ? i18n.tr("Swipe from the top right edge to open the notification bar")
46− text: i18n.tr("Swipe from the top edge to open the notification bar")
54+ : i18n.tr("Swipe from the top edge to open the notification bar")
47 anchors.top: arrow.bottom
55 anchors.top: arrow.bottom
48 anchors.topMargin: units.gu(3)
56 anchors.topMargin: units.gu(3)
49− anchors.horizontalCenter: root.horizontalCenter
57+ anchors.horizontalCenter: arrow.horizontalCenter
50− anchors.horizontalCenterOffset: (label.width - label.contentWidth) / 2
58+ anchors.horizontalCenterOffset: (width - contentWidth) / 2
51− width: root.width - units.gu(8)
59+ width: d.columnWidth - units.gu(8)
52 }
60 }
53}
61}