Fix showing preview notes in an entry without notes

Fixes #6461
This commit is contained in:
Xavier Valls 2021-05-08 12:14:23 -04:00 committed by Jonathan White
parent 8a7be101e4
commit 64279bb881

View File

@ -240,14 +240,14 @@ void EntryPreviewWidget::updateEntryGeneralTab()
m_ui->togglePasswordButton->setVisible(false);
}
if (config()->get(Config::Security_HideNotes).toBool()) {
setEntryNotesVisible(false);
m_ui->toggleEntryNotesButton->setVisible(!m_ui->entryNotesTextEdit->toPlainText().isEmpty());
m_ui->toggleEntryNotesButton->setChecked(false);
} else {
setEntryNotesVisible(true);
m_ui->toggleEntryNotesButton->setVisible(false);
}
auto hasNotes = !m_currentEntry->notes().isEmpty();
auto hideNotes = config()->get(Config::Security_HideNotes).toBool();
m_ui->entryNotesTextEdit->setVisible(hasNotes);
setEntryNotesVisible(hasNotes && !hideNotes);
m_ui->toggleEntryNotesButton->setVisible(hasNotes && hideNotes
&& !m_ui->entryNotesTextEdit->toPlainText().isEmpty());
m_ui->toggleEntryNotesButton->setChecked(false);
if (config()->get(Config::GUI_MonospaceNotes).toBool()) {
m_ui->entryNotesTextEdit->setFont(Font::fixedFont());