mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-20 12:08:24 -04:00
Display a Close button for history items.
Previously we had Ok and Cancel with the same action.
This commit is contained in:
parent
b9c9c56059
commit
f3d956ceed
3 changed files with 22 additions and 0 deletions
|
@ -23,6 +23,7 @@ EditWidget::EditWidget(QWidget* parent)
|
|||
, m_ui(new Ui::EditWidget())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setReadOnly(false);
|
||||
|
||||
QFont headerLabelFont = m_ui->headerLabel->font();
|
||||
headerLabelFont.setBold(true);
|
||||
|
@ -68,3 +69,20 @@ QLabel* EditWidget::headlineLabel()
|
|||
{
|
||||
return m_ui->headerLabel;
|
||||
}
|
||||
|
||||
void EditWidget::setReadOnly(bool readOnly)
|
||||
{
|
||||
m_readOnly = readOnly;
|
||||
|
||||
if (readOnly) {
|
||||
m_ui->buttonBox->setStandardButtons(QDialogButtonBox::Close);
|
||||
}
|
||||
else {
|
||||
m_ui->buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditWidget::readOnly() const
|
||||
{
|
||||
return m_readOnly;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue