mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
[ui] Add toggle for unblinding password fields
This commit is contained in:
@@ -70,6 +70,7 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent) :
|
||||
break;
|
||||
}
|
||||
textChanged();
|
||||
connect(ui->toggleShowPasswordButton, SIGNAL(toggled(bool)), this, SLOT(toggleShowPassword(bool)));
|
||||
connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
|
||||
connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
|
||||
connect(ui->passEdit3, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
|
||||
@@ -234,6 +235,15 @@ bool AskPassphraseDialog::event(QEvent *event)
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
void AskPassphraseDialog::toggleShowPassword(bool show)
|
||||
{
|
||||
ui->toggleShowPasswordButton->setDown(show);
|
||||
const auto mode = show ? QLineEdit::Normal : QLineEdit::Password;
|
||||
ui->passEdit1->setEchoMode(mode);
|
||||
ui->passEdit2->setEchoMode(mode);
|
||||
ui->passEdit3->setEchoMode(mode);
|
||||
}
|
||||
|
||||
bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
|
||||
{
|
||||
/* Detect Caps Lock.
|
||||
|
||||
Reference in New Issue
Block a user