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
master
sniperbeamer 17 years ago
parent a30643a99d
commit 5bb7d02298
  1. 7
      src/dialogs/PasswordDlg.cpp
  2. 6
      src/forms/PasswordDlg.ui

@ -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_Password,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxesChanged(int)));
connect(Check_KeyFile,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())); connect(Button_Back,SIGNAL(clicked()),this,SLOT(OnButtonBack()));
if(!config->showPasswordsPasswordDlg())ChangeEchoModeDatabaseKey(); if(!config->showPasswordsPasswordDlg())
ChangeEchoModeDatabaseKey();
else
ButtonChangeEchoMode->setIcon(getIcon("pwd_show"));
adjustSize(); adjustSize();
setMaximumSize(size()); setMaximumSize(size());
@ -294,10 +297,12 @@ void PasswordDialog::ChangeEchoModeDatabaseKey(){
if(Edit_Password->echoMode()==QLineEdit::Normal){ if(Edit_Password->echoMode()==QLineEdit::Normal){
Edit_Password->setEchoMode(QLineEdit::Password); Edit_Password->setEchoMode(QLineEdit::Password);
Edit_PwRepeat->setEchoMode(QLineEdit::Password); Edit_PwRepeat->setEchoMode(QLineEdit::Password);
ButtonChangeEchoMode->setIcon(getIcon("pwd_hide"));
} }
else{ else{
Edit_Password->setEchoMode(QLineEdit::Normal); Edit_Password->setEchoMode(QLineEdit::Normal);
Edit_PwRepeat->setEchoMode(QLineEdit::Normal); Edit_PwRepeat->setEchoMode(QLineEdit::Normal);
ButtonChangeEchoMode->setIcon(getIcon("pwd_show"));
} }
} }

@ -148,11 +148,7 @@
<widget class="QLineEdit" name="Edit_Password" /> <widget class="QLineEdit" name="Edit_Password" />
</item> </item>
<item> <item>
<widget class="QToolButton" name="ButtonChangeEchoMode" > <widget class="QToolButton" name="ButtonChangeEchoMode" />
<property name="text" >
<string>...</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>