You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
wow-app/wizard/WizardMain.qml

109 lines
2.7 KiB

10 years ago
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
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
10 years ago
pages[2] = createWalletPage
10 years ago
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
10 years ago
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
10 years ago
}
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)
}
}
}