From 5ce73dd108af66bf0fbf45fa20652c91ef25adc3 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 31 Oct 2016 17:02:44 +0100 Subject: add show password option to password field --- .../package/contents/ui/ImapAccountSettings.qml | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'accounts') diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index 80540912..a9ac9317 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml @@ -31,8 +31,8 @@ Item { property string accountId ImapAccount.ImapSettings { - id: imapSettings - accountIdentifier: accountId + id: imapSettings + accountIdentifier: accountId } anchors.fill: parent @@ -101,6 +101,7 @@ Item { text: "Email address" Layout.alignment: Qt.AlignRight } + TextField { Layout.fillWidth: true @@ -132,16 +133,34 @@ Item { text: "Password" Layout.alignment: Qt.AlignRight } - TextField { + + RowLayout { Layout.fillWidth: true - text: imapSettings.imapPassword - placeholderText: "Password of your email account" - echoMode: TextInput.Password - onTextChanged: { - imapSettings.imapPassword = text - imapSettings.smtpPassword = text + TextField { + id: pwField + Layout.fillWidth: true + + text: imapSettings.imapPassword + placeholderText: "Password of your email account" + echoMode: TextInput.Password + onTextChanged: { + imapSettings.imapPassword = text + imapSettings.smtpPassword = text + } + } + + CheckBox { + text: "Show Password" + onClicked: { + if(pwField.echoMode == TextInput.Password) { + pwField.echoMode = TextInput.Normal; + } else { + pwField.echoMode = TextInput.Password; + } + } } + } Kirigami.Label { -- cgit v1.2.3