mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-14 08:57:25 -04:00
wizard v0.1
This commit is contained in:
5
wizard/WizardCreateWallet.qml
Normal file
5
wizard/WizardCreateWallet.qml
Normal file
@@ -0,0 +1,5 @@
|
||||
import QtQuick 2.2
|
||||
|
||||
Item {
|
||||
|
||||
}
|
||||
96
wizard/WizardMain.qml
Normal file
96
wizard/WizardMain.qml
Normal file
@@ -0,0 +1,96 @@
|
||||
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
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
131
wizard/WizardOptions.qml
Normal file
131
wizard/WizardOptions.qml
Normal file
@@ -0,0 +1,131 @@
|
||||
import QtQuick 2.2
|
||||
|
||||
Item {
|
||||
opacity: 0
|
||||
visible: false
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
|
||||
}
|
||||
|
||||
onOpacityChanged: visible = opacity !== 0
|
||||
|
||||
Column {
|
||||
id: headerColumn
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 74
|
||||
spacing: 24
|
||||
|
||||
Text {
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 28
|
||||
//renderType: Text.NativeRendering
|
||||
color: "#3F3F3F"
|
||||
text: qsTr("I want")
|
||||
}
|
||||
|
||||
Text {
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 18
|
||||
//renderType: Text.NativeRendering
|
||||
color: "#4A4646"
|
||||
text: qsTr("Please select one of the following options:")
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 50
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 30
|
||||
|
||||
Rectangle {
|
||||
width: 202; height: 202
|
||||
radius: 101
|
||||
color: createWalletArea.containsMouse ? "#DBDBDB" : "#FFFFFF"
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "qrc:///images/createWallet.png"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: createWalletArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 16
|
||||
color: "#4A4949"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: qsTr("This is my first time, I want to<br/>create a new account")
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 30
|
||||
|
||||
Rectangle {
|
||||
width: 202; height: 202
|
||||
radius: 101
|
||||
color: recoverWalletArea.containsMouse ? "#DBDBDB" : "#FFFFFF"
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "qrc:///images/recoverWallet.png"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: recoverWalletArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 16
|
||||
color: "#4A4949"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: qsTr("I want to recover my account<br/>from my 24 work seed")
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 30
|
||||
|
||||
Rectangle {
|
||||
width: 202; height: 202
|
||||
radius: 101
|
||||
color: openAccountArea.containsMouse ? "#DBDBDB" : "#FFFFFF"
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "qrc:///images/openAccount.png"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: openAccountArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 16
|
||||
color: "#4A4949"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: qsTr("I want to open account file")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
102
wizard/WizardWelcome.qml
Normal file
102
wizard/WizardWelcome.qml
Normal file
@@ -0,0 +1,102 @@
|
||||
import QtQuick 2.2
|
||||
import QtQuick.XmlListModel 2.0
|
||||
|
||||
Item {
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
|
||||
}
|
||||
|
||||
onOpacityChanged: visible = opacity !== 0
|
||||
|
||||
Column {
|
||||
id: headerColumn
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 74
|
||||
spacing: 24
|
||||
|
||||
Text {
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 28
|
||||
//renderType: Text.NativeRendering
|
||||
color: "#3F3F3F"
|
||||
text: qsTr("Welcome")
|
||||
}
|
||||
|
||||
Text {
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 18
|
||||
//renderType: Text.NativeRendering
|
||||
color: "#4A4646"
|
||||
text: qsTr("Please choose a language and regional format.")
|
||||
}
|
||||
}
|
||||
|
||||
XmlListModel {
|
||||
id: languagesModel
|
||||
source: "file:///" + applicationDirectory + "/lang/languages.xml"
|
||||
query: "/languages/language"
|
||||
|
||||
XmlRole { name: "name"; query: "@name/string()" }
|
||||
XmlRole { name: "flag"; query: "@flag/string()" }
|
||||
XmlRole { name: "isCurrent"; query: "@enabled/string()" }
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.top: headerColumn.bottom
|
||||
anchors.topMargin: 24
|
||||
clip: true
|
||||
|
||||
model: languagesModel
|
||||
delegate: Item {
|
||||
width: listView.width
|
||||
height: 80
|
||||
|
||||
Rectangle {
|
||||
id: flagRect
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
width: 60; height: 60
|
||||
radius: 30
|
||||
color: listView.currentIndex === index ? "#DBDBDB" : "#FFFFFF"
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "file:///" + applicationDirectory + flag
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: flagRect.right
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 16
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 24
|
||||
font.bold: listView.currentIndex === index
|
||||
elide: Text.ElideRight
|
||||
color: "#3F3F3F"
|
||||
text: name
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 1
|
||||
color: "#DBDBDB"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: delegateArea
|
||||
anchors.fill: parent
|
||||
onClicked: listView.currentIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user