on xenial help sign in
Fix an issue in Tutorial
commita7e9646c5f50915832d8fd68c6d6b1cae2c87a7b authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateThu 7 Apr 2016, 13:53 (11 years ago) parentfe3aaad
3 files changed+9−1
qml/Stages/TabletStage.qml+4 qml/Tutorial/TutorialBottom.qml+1−1 tests/qmltests/Tutorial/tst_Tutorial.qml+4
qml/Stages/TabletStage.qml+4
@@ -27,8 +27,12 @@ AbstractStage {
2727 objectName: "stages"
2828 anchors.fill: parent
2929
30+ // <tutorial-hacks> The Tutorial looks into our implementation details
3031 property alias sideStageVisible: spreadView.sideStageVisible
3132 property alias sideStageWidth: spreadView.sideStageWidth
33+ // The stage the currently focused surface is in
34+ property int stageFocusedSurface: priv.focusedAppDelegate ? priv.focusedAppDelegate.stage : ApplicationInfoInterface.MainStage
35+ // </tutorial-hacks>
3236
3337 // Functions to be called from outside
3438 function updateFocusedAppOrientation() {
qml/Tutorial/TutorialBottom.qml+1−1
@@ -47,7 +47,7 @@ TutorialPage {
4747 readonly property real sideStageWidth: root.usageScenario === "tablet" && stage.sideStageVisible ?
4848 stage.sideStageWidth : 0
4949 readonly property bool isMainStageApp: usageScenario !== "tablet" ||
50− application.stage === ApplicationInfoInterface.MainStage
50+ stage.stageFocusedSurface === ApplicationInfoInterface.MainStage
5151 readonly property real dragAreaHeight: units.gu(3) // based on PageWithBottomEdge.qml
5252 readonly property real targetDistance: height * 0.2 + dragAreaHeight // based on PageWithBottomEdge.qml
5353
tests/qmltests/Tutorial/tst_Tutorial.qml+4
@@ -113,6 +113,8 @@ Rectangle {
113113 sourceComponent: Component {
114114 Shell {
115115 usageScenario: shellLoader.state
116+ nativeWidth: width
117+ nativeHeight: height
116118 property string indicatorProfile: "phone"
117119 orientation: shellLoader.shellOrientation
118120 orientations: Orientations {
@@ -401,6 +403,8 @@ Rectangle {
401403
402404 var launcher = findChild(shell, "launcher");
403405 var tutorialLeft = findChild(shell, "tutorialLeftLoader");
406+ verify(tutorialLeft);
407+
404408 touchFlick(shell, 0, halfHeight, shell.width, halfHeight);
405409
406410 tryCompare(tutorialLeft, "shown", false);