2
import Ubuntu.Components 1.3
3
import QtQuick.Window 2.2
4
import Qt.labs.settings 1.0
5
import "Storage.js" as Storage
10
property bool isPlayScreen: false
11
property bool isShowScreen: false
12
property bool isAboutScreen: false
13
property string backgroundImg: "backs/background1.svg"
14
property bool menuPanelVisible: false
15
property bool backPanelVisible: false
16
property bool binPanelVisible: false
17
property bool hasSnaps: false
18
property int panelHeight: Math.min(main_window.height / 8, units.gu(15))
20
function createElementObjects(x, y, img, widthStart, sMin, sMax)
22
var component = Qt.createComponent("Element.qml");
23
var element = component.createObject(play_field, {"x": x, "y": y, "elemImg": img, "widthStart": widthStart, "elemMinScale": sMin, "elemMaxScale": sMax});
25
if (element == null) {
27
console.log("Error creating object");
31
function recreateElementObjects(iurl, x, y, scale, mirror, width)
33
var component = Qt.createComponent("ShowElement.qml");
34
var element = component.createObject(screen_loader.item.back_listview.currentItem, {"elemImg": iurl, "x": x, "y": y, "scale": scale, "isMirror": mirror, "widthStart": width });
36
if (element == null) {
38
console.log("Error creating object");
42
function createSnapImage(imgSource)
44
var component = Qt.createComponent("SnapImage.qml")
45
var newSnap = component.createObject(main_window, {"img_source": imgSource,"img_width": play_field.width, "img_height": play_field.height})
47
if (element == null) {
49
console.log("Error creating object");
53
visibility: Window.FullScreen
57
minimumWidth: units.gu(60)
58
minimumHeight: units.gu(40)
60
Component.onCompleted: {
61
Storage.createSnapsTable()
62
Storage.createBacksTable()
68
property alias gotSnaps: main_window.hasSnaps
69
property alias backgroundImg: main_window.backgroundImg
73
applicationName: "minimakerff.mivoligo"
79
anchors.topMargin: panelHeight
81
menuPanelVisible = false
82
backPanelVisible = false
87
active: binPanelVisible
90
source: "BinPanel.qml"
94
id: start_screen_background
97
visible: !isPlayScreen && !isAboutScreen
98
source: "ui/start-back.svg"
99
sourceSize.height: parent.height
100
height: parent.height
102
bottom: parent.bottom
103
horizontalCenter: parent.horizontalCenter
105
Component.onCompleted: NumberAnimation {target: start_screen_background; property: "scale"; easing.type: Easing.OutCubic; to: 1; duration: 1000}
109
id: play_background_comp
112
source: backgroundImg
113
sourceSize.height: main_window.height - panelHeight
114
fillMode: Image.PreserveAspectCrop
124
topMargin: panelHeight
126
sourceComponent: play_background_comp
132
visible: isPlayScreen
134
anchors.topMargin: panelHeight
138
id: element_panel_loader
143
source: "ElementsPanel.qml"
154
else if (isAboutScreen) {
157
else if (!isPlayScreen) {
167
anchors.centerIn: parent