Restyled password dialog

This commit is contained in:
Sander Ferdinand
2018-03-22 03:51:57 +01:00
committed by moneromooo-monero
parent 916c7acbb7
commit 72a7fac467

View File

@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.0 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
@@ -38,13 +38,6 @@ import "../components" as MoneroComponents
Item { Item {
id: root id: root
visible: false visible: false
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
@@ -61,7 +54,7 @@ Item {
titleBar.enabled = false titleBar.enabled = false
show() show()
root.visible = true; root.visible = true;
passwordInput.focus = true passwordInput.forceActiveFocus();
passwordInput.text = "" passwordInput.text = ""
} }
@@ -82,41 +75,52 @@ Item {
ColumnLayout { ColumnLayout {
id: column id: column
//anchors {fill: parent; margins: 16 } //anchors {fill: parent; margins: 16 }
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: 400 * scaleRatio
Label { Label {
text: root.walletName.length > 0 ? qsTr("Please enter wallet password for:<br>") + root.walletName : qsTr("Please enter wallet password") text: qsTr("Please enter wallet password")
Layout.alignment: Qt.AlignHCenter anchors.left: parent.left
Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 18 * scaleRatio font.pixelSize: 16 * scaleRatio
font.family: "Arial" font.family: Style.fontLight
color: "#555555"
color: Style.defaultFontColor
} }
TextField { TextField {
id : passwordInput id : passwordInput
Layout.topMargin: 8
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter anchors.left: parent.left
Layout.maximumWidth: 400 * scaleRatio horizontalAlignment: TextInput.AlignLeft
horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: TextInput.AlignVCenter verticalAlignment: TextInput.AlignVCenter
font.family: "Arial" font.family: Style.fontLight
font.pixelSize: 32 * scaleRatio font.pixelSize: 24 * scaleRatio
echoMode: TextInput.Password echoMode: TextInput.Password
KeyNavigation.tab: okButton KeyNavigation.tab: okButton
bottomPadding: 10
style: TextFieldStyle { leftPadding: 10
renderType: Text.NativeRendering topPadding: 10
textColor: "#35B05A" color: "white"
passwordCharacter: "•"
// no background
background: Rectangle { background: Rectangle {
radius: 0 radius: 2
border.width: 0 border.color: Qt.rgba(255, 255, 255, 0.35)
border.width: 1
color: "black"
Image {
width: 12
height: 16
source: "../images/lockIcon.png"
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
} }
} }
Keys.onReturnPressed: { Keys.onReturnPressed: {
root.close() root.close()
root.accepted() root.accepted()
@@ -127,28 +131,18 @@ Item {
root.rejected() root.rejected()
} }
} }
// underline
Rectangle {
height: 1
color: "#DBDBDB"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
anchors.bottomMargin: 3
Layout.maximumWidth: passwordInput.width
}
}
// Ok/Cancel buttons // Ok/Cancel buttons
RowLayout { RowLayout {
id: buttons id: buttons
spacing: 60 * scaleRatio spacing: 16 * scaleRatio
Layout.alignment: Qt.AlignHCenter Layout.topMargin: 16
Layout.alignment: Qt.AlignRight
MoneroComponents.StandardButton { MoneroComponents.StandardButton {
id: cancelButton id: cancelButton
small: true
text: qsTr("Cancel") + translationManager.emptyString text: qsTr("Cancel") + translationManager.emptyString
KeyNavigation.tab: passwordInput KeyNavigation.tab: passwordInput
onClicked: { onClicked: {
@@ -156,8 +150,10 @@ Item {
root.rejected() root.rejected()
} }
} }
MoneroComponents.StandardButton { MoneroComponents.StandardButton {
id: okButton id: okButton
small: true
text: qsTr("Continue") text: qsTr("Continue")
KeyNavigation.tab: cancelButton KeyNavigation.tab: cancelButton
onClicked: { onClicked: {
@@ -166,5 +162,14 @@ Item {
} }
} }
} }
}
}
Rectangle {
id: bg
anchors.fill: parent
color: "black"
opacity: 0.8
} }
} }