aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-11-01 15:01:24 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-11-01 15:01:24 +0300
commit7973d0cbcc5646a401132aa320fe801c2e58e2b1 (patch)
tree7f0aadef26645fdca97e392a041c6400c26644a8 /components
parent6c6b10855f23195cb2b6bd2acd45995947592997 (diff)
downloadmonzero-gui-7973d0cbcc5646a401132aa320fe801c2e58e2b1.tar.gz
monzero-gui-7973d0cbcc5646a401132aa320fe801c2e58e2b1.tar.xz
monzero-gui-7973d0cbcc5646a401132aa320fe801c2e58e2b1.zip
Custom password dialog. fixes issue with standard dialog
Diffstat (limited to 'components')
-rw-r--r--components/PasswordDialog.qml132
1 files changed, 112 insertions, 20 deletions
diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml
index 69a2ae91..c93a94ec 100644
--- a/components/PasswordDialog.qml
+++ b/components/PasswordDialog.qml
@@ -31,37 +31,129 @@ 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
+ 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"
+ }
- Label {
- text: qsTr("Please enter wallet password")
- Layout.columnSpan: 2
- Layout.fillWidth: true
- font.family: "Arial"
- font.pixelSize: 32
+ 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
+ style: TextFieldStyle {
+ renderType: Text.NativeRendering
+ textColor: "#35B05A"
+ passwordCharacter: "•"
+ // no background
+ background: Rectangle {
+ radius: 0
+ border.width: 0
+ }
+ }
+
+ }
+ // 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")
- echoMode: TextInput.Password
- focus: true
- Layout.fillWidth: true
- font.family: "Arial"
- font.pixelSize: 24
- style: TextFieldStyle {
- passwordCharacter: "•"
+ onClicked: {
+ accepted()
+ close()
+ }
+ }
+
+ MoneroComponents.StandardButton {
+ id: cancelButton
+ width: 120
+ fontSize: 14
+ shadowReleasedColor: "#FF4304"
+ shadowPressedColor: "#B32D00"
+ releasedColor: "#FF6C3C"
+ pressedColor: "#FF4304"
+ text: qsTr("Cancel")
+ onClicked: {
+ rejected()
+ close()
+ }
}
}
}
}
+
+