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
leftPadding: 10
topPadding: 10
color: "white"
background: Rectangle {
radius: 2
border.color: Qt.rgba(255, 255, 255, 0.35)
border.width: 1
color: "black"
style: TextFieldStyle { Image {
renderType: Text.NativeRendering width: 12
textColor: "#35B05A" height: 16
passwordCharacter: "•" source: "../images/lockIcon.png"
// no background anchors.verticalCenter: parent.verticalCenter
background: Rectangle { anchors.right: parent.right
radius: 0 anchors.rightMargin: 20
border.width: 0
} }
} }
Keys.onReturnPressed: { Keys.onReturnPressed: {
root.close() root.close()
root.accepted() root.accepted()
@@ -127,44 +131,45 @@ 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
} RowLayout {
// Ok/Cancel buttons id: buttons
RowLayout { spacing: 16 * scaleRatio
id: buttons Layout.topMargin: 16
spacing: 60 * scaleRatio Layout.alignment: Qt.AlignRight
Layout.alignment: Qt.AlignHCenter
MoneroComponents.StandardButton { MoneroComponents.StandardButton {
id: cancelButton id: cancelButton
text: qsTr("Cancel") + translationManager.emptyString small: true
KeyNavigation.tab: passwordInput text: qsTr("Cancel") + translationManager.emptyString
onClicked: { KeyNavigation.tab: passwordInput
root.close() onClicked: {
root.rejected() root.close()
} root.rejected()
} }
MoneroComponents.StandardButton { }
id: okButton
text: qsTr("Continue") MoneroComponents.StandardButton {
KeyNavigation.tab: cancelButton id: okButton
onClicked: { small: true
root.close() text: qsTr("Continue")
root.accepted() KeyNavigation.tab: cancelButton
onClicked: {
root.close()
root.accepted()
}
} }
} }
} }
} }
Rectangle {
id: bg
anchors.fill: parent
color: "black"
opacity: 0.8
}
} }