summaryrefslogtreecommitdiffstats
path: root/chicken-wranglers/src/qml/common.js
blob: 2ce15850d45cb82367046aa695840449fa2fb6a3 (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
var tempFrom
var tempTo

function switchScreens(from, to) {
    if (!from || !to)
        return

    tempFrom = from
    tempTo = to

    from.hide()
    from.opacityChanged.connect(showNextScreen)
}

function showNextScreen() {
    if (tempFrom.opacity == 0) {
        tempTo.show()
    }
}

function getImagePath(basePath, fileName) {
    if (basePath == "")
        return ""

    return basePath + "/" + fileName
}