From 5bb7d022981299fa3952302afb7ca135d63ba6f2 Mon Sep 17 00:00:00 2001 From: sniperbeamer Date: Sat, 15 Mar 2008 17:08:11 +0000 Subject: [PATCH] PasswordDlg: use icon for button to show/hide the typed password git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@189 b624d157-de02-0410-bad0-e51aec6abb33 --- src/dialogs/PasswordDlg.cpp | 7 ++++++- src/forms/PasswordDlg.ui | 6 +----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dialogs/PasswordDlg.cpp b/src/dialogs/PasswordDlg.cpp index 2690ed0..c293054 100644 --- a/src/dialogs/PasswordDlg.cpp +++ b/src/dialogs/PasswordDlg.cpp @@ -149,7 +149,10 @@ PasswordDialog::PasswordDialog(QWidget* parent,DlgMode mode,DlgFlags flags,const connect(Check_Password,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxesChanged(int))); connect(Check_KeyFile,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxesChanged(int))); connect(Button_Back,SIGNAL(clicked()),this,SLOT(OnButtonBack())); - if(!config->showPasswordsPasswordDlg())ChangeEchoModeDatabaseKey(); + if(!config->showPasswordsPasswordDlg()) + ChangeEchoModeDatabaseKey(); + else + ButtonChangeEchoMode->setIcon(getIcon("pwd_show")); adjustSize(); setMaximumSize(size()); @@ -294,10 +297,12 @@ void PasswordDialog::ChangeEchoModeDatabaseKey(){ if(Edit_Password->echoMode()==QLineEdit::Normal){ Edit_Password->setEchoMode(QLineEdit::Password); Edit_PwRepeat->setEchoMode(QLineEdit::Password); + ButtonChangeEchoMode->setIcon(getIcon("pwd_hide")); } else{ Edit_Password->setEchoMode(QLineEdit::Normal); Edit_PwRepeat->setEchoMode(QLineEdit::Normal); + ButtonChangeEchoMode->setIcon(getIcon("pwd_show")); } } diff --git a/src/forms/PasswordDlg.ui b/src/forms/PasswordDlg.ui index 24d8122..b67796d 100644 --- a/src/forms/PasswordDlg.ui +++ b/src/forms/PasswordDlg.ui @@ -148,11 +148,7 @@ - - - ... - - +