monero-gui/wizard/WizardMain.qml

171 lines
4.4 KiB
QML
Raw Normal View History

2014-08-19 15:58:02 +03:00
import QtQuick 2.2
2014-08-29 11:44:31 +03:00
import "../components"
2014-08-19 15:58:02 +03:00
Rectangle {
id: wizard
2014-08-29 11:44:31 +03:00
signal useMoneroClicked()
2014-08-19 15:58:02 +03:00
border.color: "#DBDBDB"
border.width: 1
color: "#FFFFFF"
Rectangle {
id: nextButton
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 50
2014-08-21 13:09:52 +03:00
visible: wizard.currentPage !== 1 && wizard.currentPage !== 6
2014-08-19 15:58:02 +03:00
width: 50; height: 50
radius: 25
color: nextArea.containsMouse ? "#FF4304" : "#FF6C3C"
Image {
anchors.centerIn: parent
anchors.horizontalCenterOffset: 3
source: "qrc:///images/nextPage.png"
}
MouseArea {
id: nextArea
anchors.fill: parent
hoverEnabled: true
onClicked: wizard.switchPage(true)
}
}
property int currentPage: 0
function switchPage(next) {
var pages = new Array()
pages[0] = welcomePage
pages[1] = optionsPage
2014-08-20 22:19:21 +03:00
pages[2] = createWalletPage
2014-08-21 13:09:52 +03:00
pages[3] = passwordPage
pages[4] = configurePage
pages[5] = donationPage
pages[6] = finishPage
2014-08-19 15:58:02 +03:00
if(next === false) {
if(currentPage > 0) {
pages[currentPage].opacity = 0
pages[--currentPage].opacity = 1
}
} else {
if(currentPage < pages.length - 1) {
pages[currentPage].opacity = 0
pages[++currentPage].opacity = 1
}
}
}
WizardWelcome {
id: welcomePage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
}
WizardOptions {
id: optionsPage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
2014-08-20 22:19:21 +03:00
onCreateWalletClicked: wizard.switchPage(true)
}
WizardCreateWallet {
id: createWalletPage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
2014-08-19 15:58:02 +03:00
}
2014-08-21 13:09:52 +03:00
WizardPassword {
id: passwordPage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
}
WizardConfigure {
id: configurePage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
}
WizardDonation {
id: donationPage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
}
WizardFinish {
id: finishPage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
}
2014-08-19 15:58:02 +03:00
Rectangle {
id: prevButton
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 50
visible: parent.currentPage > 0
width: 50; height: 50
radius: 25
color: prevArea.containsMouse ? "#FF4304" : "#FF6C3C"
Image {
anchors.centerIn: parent
anchors.horizontalCenterOffset: -3
source: "qrc:///images/prevPage.png"
}
MouseArea {
id: prevArea
anchors.fill: parent
hoverEnabled: true
onClicked: wizard.switchPage(false)
}
}
2014-08-29 11:44:31 +03:00
StandardButton {
id: sendButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 50
width: 110
text: qsTr("USE MONERO")
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
visible: parent.currentPage === 6
onClicked: wizard.useMoneroClicked()
}
2014-08-19 15:58:02 +03:00
}