Showing with 139 additions and 28 deletions.
  1. +127 −21 components/PasswordDialog.qml
  2. +9 −0 components/StandardButton.qml
  3. +2 −4 main.qml
  4. +1 −3 pages/Settings.qml
@@ -31,37 +31,143 @@ import QtQuick.Controls 1.4
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.0

// import "../components"
import "../components" as MoneroComponents

Dialog {
Window {
id: root
modality: Qt.ApplicationModal
flags: Qt.Window | Qt.FramelessWindowHint
property alias password: passwordInput.text
standardButtons: StandardButton.Ok + StandardButton.Cancel

// same signals as Dialog has
signal accepted()
signal rejected()


function open() {
show()
}

// TODO: implement without hardcoding sizes
width: 480
height: 200

ColumnLayout {
id: column
anchors.fill: parent

Label {
text: qsTr("Please enter wallet password")
Layout.columnSpan: 2
Layout.fillWidth: true
font.family: "Arial"
font.pixelSize: 32
id: mainLayout
spacing: 10
anchors { fill: parent; margins: 35 }

ColumnLayout {
id: column
//anchors {fill: parent; margins: 16 }
Layout.alignment: Qt.AlignHCenter

Label {
text: qsTr("Please enter wallet password")
Layout.alignment: Qt.AlignHCenter
Layout.columnSpan: 2
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 24
font.family: "Arial"
color: "#555555"
}

TextField {
id : passwordInput
focus: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: TextInput.AlignVCenter
font.family: "Arial"
font.pixelSize: 32
echoMode: TextInput.Password
KeyNavigation.tab: okButton

style: TextFieldStyle {
renderType: Text.NativeRendering
textColor: "#35B05A"
passwordCharacter: ""
// no background
background: Rectangle {
radius: 0
border.width: 0
}
}
Keys.onReturnPressed: {
root.accepted()
root.close()
}

Keys.onEscapePressed: {
root.rejected()
root.close()
}


}
// underline
Rectangle {
height: 1
color: "#DBDBDB"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
anchors.bottomMargin: 3

}
// padding
Rectangle {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
height: 10
opacity: 0
color: "black"
}
}
// Ok/Cancel buttons
RowLayout {
id: buttons
spacing: 60
Layout.alignment: Qt.AlignHCenter

TextField {
id : passwordInput
MoneroComponents.StandardButton {
id: okButton
width: 120
fontSize: 14
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
text: qsTr("Ok")
KeyNavigation.tab: cancelButton
onClicked: {
root.accepted()
root.close()
}
}

echoMode: TextInput.Password
focus: true
Layout.fillWidth: true
font.family: "Arial"
font.pixelSize: 24
style: TextFieldStyle {
passwordCharacter: ""
MoneroComponents.StandardButton {
id: cancelButton
width: 120
fontSize: 14
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
text: qsTr("Cancel")
KeyNavigation.tab: passwordInput
onClicked: {
root.rejected()
root.close()
}
}
}
}

}



@@ -41,6 +41,7 @@ Item {
property alias text: label.text
signal clicked()


Rectangle {
anchors.left: parent.left
anchors.right: parent.right
@@ -51,6 +52,9 @@ Item {
parent.enabled ? (buttonArea.pressed ? parent.shadowPressedColor : parent.shadowReleasedColor)
: Qt.lighter(parent.shadowReleasedColor)
}
border.color: Qt.darker(parent.releasedColor)
border.width: parent.focus ? 1 : 0

}

Rectangle {
@@ -64,6 +68,8 @@ Item {

}
//radius: 4


}

Text {
@@ -92,4 +98,7 @@ Item {
anchors.fill: parent
onClicked: parent.clicked()
}

Keys.onSpacePressed: clicked()
Keys.onReturnPressed: clicked()
}
@@ -546,7 +546,7 @@ ApplicationWindow {

PasswordDialog {
id: passwordDialog
standardButtons: StandardButton.Ok + StandardButton.Cancel

onAccepted: {
appWindow.currentWallet = null
appWindow.initialize();
@@ -555,9 +555,7 @@ ApplicationWindow {
//appWindow.enableUI(false)
rootItem.state = "wizard"
}
onDiscard: {
appWindow.enableUI(false)
}

}


@@ -61,7 +61,7 @@ Rectangle {

PasswordDialog {
id: settingsPasswordDialog
standardButtons: StandardButton.Ok + StandardButton.Cancel

onAccepted: {
if(appWindow.password === settingsPasswordDialog.password){
memoTextInput.text = currentWallet.seed
@@ -72,9 +72,7 @@ Rectangle {
onRejected: {

}
onDiscard: {

}
}