summaryrefslogtreecommitdiffstats
path: root/chicken-wranglers/src/qml/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'chicken-wranglers/src/qml/common.js')
-rw-r--r--chicken-wranglers/src/qml/common.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/chicken-wranglers/src/qml/common.js b/chicken-wranglers/src/qml/common.js
new file mode 100644
index 0000000..2ce1585
--- /dev/null
+++ b/chicken-wranglers/src/qml/common.js
@@ -0,0 +1,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
+}