summaryrefslogtreecommitdiffstats
path: root/QtDemo/qml/QtDemo/NavigationPanel.qml
blob: a88584603b57ca91ce976cc6a30cf2ec4459935a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import QtQuick 2.0

Grid {
    id: root

    function checkOrientation() {
        root.spacing = (app.height + app.width) * 0.02

        if (app.width >= app.height) {
            root.columns = 1
            root.anchors.bottom = undefined
            root.anchors.horizontalCenter = undefined
            root.anchors.right = app.right
            root.anchors.verticalCenter = app.verticalCenter
            root.anchors.rightMargin = app.width * 0.02
            root.anchors.bottomMargin = 0
        }
        else {
            root.columns = 3
            root.anchors.right = undefined
            root.anchors.verticalCenter = undefined
            root.anchors.bottom = app.bottom
            root.anchors.horizontalCenter = app.horizontalCenter
            root.anchors.rightMargin = 0
            root.anchors.bottomMargin = app.width * 0.02
        }
    }

    Button {
        id: nextButton
        imageSource: "images/btn_next.png"
        onClicked: canvas.goNext()
    }

    Button {
        id: prevButton
        imageSource: "images/btn_previous.png"
        onClicked: canvas.goPrevious()
    }

    Button {
        id: homeButton
        imageSource: "images/btn_home.png"
        onClicked: {
            if (app.navigationState===0){
                helpscreen.show()
                return;
            }
            canvas.goBack()
        }
    }
}