Files
thehub/pos/qml/mainwindow.qml
T

106 lines
2.8 KiB
QML
Raw Permalink Normal View History

2018-02-21 18:46:54 +01:00
/*
* This file is part of the Flowee project
2021-06-20 22:44:44 +02:00
* Copyright (C) 2018 Tom Zander <tom@flowee.org>
2018-02-21 18:46:54 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import QtQuick.Controls 2.0
import org.flowee 1.0
ApplicationWindow {
id: mainWindow
width: 300
height: 480
visible: true
minimumHeight: 200
minimumWidth: 200
title: qsTr("PoS")
Component.onCompleted: {
Payments.connectToDB()
}
Pane {
id: contentArea
anchors.fill: parent
2018-03-27 00:06:55 +02:00
InputPaymentScreen {
2018-02-21 18:46:54 +01:00
id: inputPaymentScreen
height: parent.height
2018-03-27 00:06:55 +02:00
width: parent.width
2018-02-21 18:46:54 +01:00
}
2018-03-27 00:06:55 +02:00
ShowQR {
2018-02-21 18:46:54 +01:00
id: showQR
height: parent.height
2018-03-27 00:06:55 +02:00
width: parent.width
2018-02-21 18:46:54 +01:00
}
state: "input"
states: [
State {
name: "input"
when: Payments.paymentStep === Payments.NoPayment
PropertyChanges {
target: showQR; x: width + 10; opacity: 0
}
2018-03-27 00:06:55 +02:00
PropertyChanges {
target: completedPaymentScreen; x: width + 10; opacity: 0
}
2018-02-21 18:46:54 +01:00
},
State {
name: "showQr"
2018-03-27 00:06:55 +02:00
when: Payments.paymentStep >= Payments.ShowPayment
2018-02-21 18:46:54 +01:00
PropertyChanges {
target: inputPaymentScreen; x: -width - 10; opacity: 0
}
2018-03-27 00:06:55 +02:00
PropertyChanges {
target: completedPaymentScreen; x: -width - 10; opacity: 0
}
2018-02-21 18:46:54 +01:00
}
]
}
Item {
id: missingNetwork
width: parent.width
height: 80
y: {
if (Payments.connected === Payments.Connected)
return parent.height + 10
return parent.height - height
}
Behavior on y { NumberAnimation { duration: 300 } }
Rectangle {
width: parent.width - 10
x: 5
height: parent.height + 20
radius: 20
color: "#ffae4b"
border.width: 3
border.color: "#7d5524"
}
Text {
text: "Connecting"
font.pointSize: 18
anchors.centerIn: parent
}
}
}