monero-gui/wizard/WizardMain.qml
2014-08-21 12:09:52 +02:00

153 lines
3.9 KiB
QML

import QtQuick 2.2
Rectangle {
id: wizard
border.color: "#DBDBDB"
border.width: 1
color: "#FFFFFF"
Rectangle {
id: nextButton
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 50
visible: wizard.currentPage !== 1 && wizard.currentPage !== 6
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
pages[2] = createWalletPage
pages[3] = passwordPage
pages[4] = configurePage
pages[5] = donationPage
pages[6] = finishPage
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
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
}
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
}
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)
}
}
}