1
mirror of https://github.com/monero-project/monero-gui synced 2024-11-19 13:37:13 +01:00

password dialog mobile redesign

This commit is contained in:
Jaquee 2017-08-08 10:40:28 +02:00
parent f605793cfc
commit e0e69b35bd

View File

@ -35,37 +35,45 @@ import QtQuick.Window 2.0
import "../components" as MoneroComponents import "../components" as MoneroComponents
Window { Item {
id: root id: root
modality: Qt.ApplicationModal visible: false
flags: Qt.Window | Qt.FramelessWindowHint Rectangle {
id: bg
z: parent.z + 1
anchors.fill: parent
color: "white"
opacity: 0.9
}
property alias password: passwordInput.text property alias password: passwordInput.text
property string walletName property string walletName
// same signals as Dialog has // same signals as Dialog has
signal accepted() signal accepted()
signal rejected() signal rejected()
signal closeCallback()
function open(walletName) { function open(walletName) {
root.walletName = walletName ? walletName : "" root.walletName = walletName ? walletName : ""
leftPanel.enabled = false
middlePanel.enabled = false
titleBar.enabled = false
show() show()
root.visible = true;
passwordInput.focus = true
} }
// TODO: implement without hardcoding sizes function close() {
// width: isMobile ? screenWidth : 480 leftPanel.enabled = true
// height: isMobile ? screenHeight - mobileHeader.height : walletName ? 240 : 200 middlePanel.enabled = true
titleBar.enabled = true
// Make window draggable root.visible = false;
MouseArea { closeCallback();
anchors.fill: parent
property point lastMousePos: Qt.point(0, 0)
onPressed: { lastMousePos = Qt.point(mouseX, mouseY); }
onMouseXChanged: root.x += (mouseX - lastMousePos.x)
onMouseYChanged: root.y += (mouseY - lastMousePos.y)
} }
ColumnLayout { ColumnLayout {
z: bg.z + 1
id: mainLayout id: mainLayout
spacing: 10 spacing: 10
anchors { fill: parent; margins: 35 * scaleRatio } anchors { fill: parent; margins: 35 * scaleRatio }
@ -128,16 +136,9 @@ Window {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
anchors.bottomMargin: 3 anchors.bottomMargin: 3
Layout.maximumWidth: passwordInput.width
} }
// padding
Rectangle {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
height: 10
opacity: 0
color: "black"
}
} }
// Ok/Cancel buttons // Ok/Cancel buttons
RowLayout { RowLayout {
@ -174,6 +175,3 @@ Window {
} }
} }
} }