From dbf9587775432c6ec02fd514e10ed17317cac7d7 Mon Sep 17 00:00:00 2001 From: techninja1008 Date: Tue, 8 Oct 2024 04:42:22 +0100 Subject: [PATCH 1/5] Add database name, color, and icon options for unlock view (#10819) Closes #10783 Adds three database configuration options (stored as public custom data) that allow a database to have a public name/summary, color, and/or icon to be displayed on the unlock screen. This information is configured in the Database Settings and stored in the database public custom data (ie, unencrypted). The name/summary is stored in KPXC_PUBLIC_NAME, the color is stored in KPXC_PUBLIC_COLOR, and the icon is stored in KPXC_PUBLIC_ICON. --------- Co-authored-by: Jonathan White --- share/translations/keepassxc_en.ts | 44 +++++ src/core/Database.cpp | 48 +++++ src/core/Database.h | 7 + src/gui/DatabaseOpenWidget.cpp | 26 ++- src/gui/DatabaseOpenWidget.ui | 58 ++++-- .../DatabaseSettingsWidgetGeneral.cpp | 96 ++++++++++ .../DatabaseSettingsWidgetGeneral.h | 9 + .../DatabaseSettingsWidgetGeneral.ui | 173 ++++++++++++++++-- src/gui/styles/base/basestyle.qss | 2 +- src/gui/styles/base/classicstyle.qss | 2 +- 10 files changed, 437 insertions(+), 28 deletions(-) diff --git a/share/translations/keepassxc_en.ts b/share/translations/keepassxc_en.ts index 718015913..daaa67606 100644 --- a/share/translations/keepassxc_en.ts +++ b/share/translations/keepassxc_en.ts @@ -2194,6 +2194,50 @@ removed from the database. Autosave delay since last change checkbox + + Public Database Metadata + + + + Warning: the following settings are not encrypted. + + + + Display name: + + + + Publically visible display name used on the unlock dialog + + + + Database public display name + + + + Display color: + + + + Publically visible color used on the unlock dialog + + + + Database public display color chooser + + + + Clear + + + + Display icon: + + + + Select Database Icon + + DatabaseSettingsWidgetKeeShare diff --git a/src/core/Database.cpp b/src/core/Database.cpp index b91601256..5734f9521 100644 --- a/src/core/Database.cpp +++ b/src/core/Database.cpp @@ -1051,6 +1051,54 @@ QUuid Database::publicUuid() return QUuid::fromRfc4122(publicCustomData()["KPXC_PUBLIC_UUID"].toByteArray()); } +QString Database::publicName() +{ + return publicCustomData().value("KPXC_PUBLIC_NAME").toString(); +} + +void Database::setPublicName(const QString& name) +{ + if (name.isEmpty()) { + publicCustomData().remove("KPXC_PUBLIC_NAME"); + } else { + publicCustomData().insert("KPXC_PUBLIC_NAME", name); + } + markAsModified(); +} + +QString Database::publicColor() +{ + return publicCustomData().value("KPXC_PUBLIC_COLOR").toString(); +} + +void Database::setPublicColor(const QString& color) +{ + if (color.isEmpty()) { + publicCustomData().remove("KPXC_PUBLIC_COLOR"); + } else { + publicCustomData().insert("KPXC_PUBLIC_COLOR", color); + } + markAsModified(); +} + +int Database::publicIcon() +{ + if (publicCustomData().contains("KPXC_PUBLIC_ICON")) { + return publicCustomData().value("KPXC_PUBLIC_ICON").toInt(); + } + return -1; +} + +void Database::setPublicIcon(int iconIndex) +{ + if (iconIndex < 0) { + publicCustomData().remove("KPXC_PUBLIC_ICON"); + } else { + publicCustomData().insert("KPXC_PUBLIC_ICON", iconIndex); + } + markAsModified(); +} + void Database::markAsTemporaryDatabase() { m_isTemporaryDatabase = true; diff --git a/src/core/Database.h b/src/core/Database.h index d4e8aac2a..29314650e 100644 --- a/src/core/Database.h +++ b/src/core/Database.h @@ -108,6 +108,13 @@ public: QString canonicalFilePath() const; void setFilePath(const QString& filePath); + QString publicName(); + void setPublicName(const QString& name); + QString publicColor(); + void setPublicColor(const QString& color); + int publicIcon(); + void setPublicIcon(int iconIndex); + Metadata* metadata(); const Metadata* metadata() const; Group* rootGroup(); diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index 5d45b3531..14d8f4650 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -72,7 +72,6 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent) font.setPointSize(font.pointSize() + 4); font.setBold(true); m_ui->labelHeadline->setFont(font); - m_ui->labelHeadline->setText(tr("Unlock KeePassXC Database")); m_ui->quickUnlockButton->setFont(font); m_ui->quickUnlockButton->setIcon( @@ -229,6 +228,31 @@ void DatabaseOpenWidget::load(const QString& filename) m_ui->fileNameLabel->setRawText(m_filename); + // Set the public name if defined + auto label = tr("Unlock KeePassXC Database"); + if (!m_db->publicName().isEmpty()) { + label.append(QString(": %1").arg(m_db->publicName())); + } + m_ui->labelHeadline->setText(label); + + // Apply the public color to the central unlock stack if defined + auto color = m_db->publicColor(); + if (!color.isEmpty()) { + m_ui->centralStack->setStyleSheet(QString("QStackedWidget {border: 4px solid %1}").arg(color)); + } else { + m_ui->centralStack->setStyleSheet(""); + } + + // Show the database icon if defined + auto iconIndex = m_db->publicIcon(); + if (iconIndex >= 0 && iconIndex < databaseIcons()->count()) { + m_ui->dbIconLabel->setPixmap(databaseIcons()->icon(iconIndex, IconSize::Large)); + m_ui->dbIconLabel->setVisible(true); + } else { + m_ui->dbIconLabel->setPixmap({}); + m_ui->dbIconLabel->setVisible(false); + } + if (config()->get(Config::RememberLastKeyFiles).toBool()) { auto lastKeyFiles = config()->get(Config::LastKeyFiles).toHash(); if (lastKeyFiles.contains(m_filename)) { diff --git a/src/gui/DatabaseOpenWidget.ui b/src/gui/DatabaseOpenWidget.ui index a045ba82c..1ef04a528 100644 --- a/src/gui/DatabaseOpenWidget.ui +++ b/src/gui/DatabaseOpenWidget.ui @@ -55,18 +55,54 @@ - - - - 12 - 75 - true - + + + 9 - - Unlock KeePassXC Database - - + + + + + 32 + 32 + + + + + + + true + + + + + + + + 12 + 75 + true + + + + Unlock KeePassXC Database + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp index 84b903b5c..c8a9ec8dc 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp @@ -18,9 +18,16 @@ #include "DatabaseSettingsWidgetGeneral.h" #include "ui_DatabaseSettingsWidgetGeneral.h" +#include +#include +#include +#include + #include "core/Clock.h" #include "core/Group.h" #include "core/Metadata.h" +#include "gui/DatabaseIcons.h" +#include "gui/IconModels.h" #include "gui/MessageBox.h" DatabaseSettingsWidgetGeneral::DatabaseSettingsWidgetGeneral(QWidget* parent) @@ -29,6 +36,11 @@ DatabaseSettingsWidgetGeneral::DatabaseSettingsWidgetGeneral(QWidget* parent) { m_ui->setupUi(this); + connect(m_ui->dbPublicColorButton, &QPushButton::clicked, this, &DatabaseSettingsWidgetGeneral::pickPublicColor); + connect(m_ui->dbPublicColorClearButton, &QPushButton::clicked, this, [this] { setupPublicColorButton({}); }); + connect(m_ui->dbPublicIconButton, &QPushButton::clicked, this, &DatabaseSettingsWidgetGeneral::pickPublicIcon); + connect(m_ui->dbPublicIconClearButton, &QPushButton::clicked, this, [this] { setupPublicIconButton(-1); }); + connect(m_ui->historyMaxItemsCheckBox, SIGNAL(toggled(bool)), m_ui->historyMaxItemsSpinBox, SLOT(setEnabled(bool))); connect(m_ui->historyMaxSizeCheckBox, SIGNAL(toggled(bool)), m_ui->historyMaxSizeSpinBox, SLOT(setEnabled(bool))); connect(m_ui->autosaveDelayCheckBox, SIGNAL(toggled(bool)), m_ui->autosaveDelaySpinBox, SLOT(setEnabled(bool))); @@ -46,6 +58,10 @@ void DatabaseSettingsWidgetGeneral::initialize() m_ui->defaultUsernameEdit->setText(meta->defaultUserName()); m_ui->compressionCheckbox->setChecked(m_db->compressionAlgorithm() != Database::CompressionNone); + m_ui->dbPublicName->setText(m_db->publicName()); + setupPublicColorButton(m_db->publicColor()); + setupPublicIconButton(m_db->publicIcon()); + if (meta->historyMaxItems() > -1) { m_ui->historyMaxItemsSpinBox->setValue(meta->historyMaxItems()); m_ui->historyMaxItemsCheckBox->setChecked(true); @@ -116,6 +132,10 @@ bool DatabaseSettingsWidgetGeneral::saveSettings() meta->setRecycleBinEnabled(m_ui->recycleBinEnabledCheckBox->isChecked()); meta->setSettingsChanged(Clock::currentDateTimeUtc()); + m_db->setPublicName(m_ui->dbPublicName->text()); + m_db->setPublicColor(m_ui->dbPublicColorButton->property("color").toString()); + m_db->setPublicIcon(m_ui->dbPublicIconButton->property("iconIndex").toInt()); + bool truncate = false; int historyMaxItems; @@ -155,3 +175,79 @@ bool DatabaseSettingsWidgetGeneral::saveSettings() return true; } + +void DatabaseSettingsWidgetGeneral::pickPublicColor() +{ + auto oldColor = QColor(m_ui->dbPublicColorButton->property("color").toString()); + auto newColor = QColorDialog::getColor(oldColor); + if (newColor.isValid()) { + setupPublicColorButton(newColor); + } +} + +void DatabaseSettingsWidgetGeneral::setupPublicColorButton(const QColor& color) +{ + m_ui->dbPublicColorClearButton->setVisible(color.isValid()); + if (color.isValid()) { + m_ui->dbPublicColorButton->setStyleSheet(QString("background-color:%1").arg(color.name())); + m_ui->dbPublicColorButton->setProperty("color", color.name()); + } else { + m_ui->dbPublicColorButton->setStyleSheet(""); + m_ui->dbPublicColorButton->setProperty("color", {}); + } +} + +void DatabaseSettingsWidgetGeneral::pickPublicIcon() +{ + QDialog dialog(this); + dialog.setSizeGripEnabled(false); + dialog.setWindowTitle(tr("Select Database Icon")); + + auto iconList = new QListView; + iconList->setFlow(QListView::LeftToRight); + iconList->setMovement(QListView::Static); + iconList->setResizeMode(QListView::Adjust); + iconList->setWrapping(true); + iconList->setSpacing(4); + + auto iconModel = new DefaultIconModel; + iconList->setModel(iconModel); + if (m_ui->dbPublicIconButton->property("iconIndex").toInt() >= 0) { + iconList->setCurrentIndex(iconModel->index(m_ui->dbPublicIconButton->property("iconIndex").toInt(), 0)); + } else { + iconList->setCurrentIndex(iconModel->index(0, 0)); + } + + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + auto layout = new QVBoxLayout(&dialog); + layout->addWidget(iconList); + layout->addWidget(buttonBox); + + // Resize the dialog to fit the default icon list + auto cellSize = iconList->sizeHintForIndex(iconModel->index(0, 0)); + auto spacing = iconList->spacing() * 2; + dialog.resize((cellSize.width() + spacing) * 15, (cellSize.height() + spacing) * 6 + 16); + + connect(iconList, &QListView::doubleClicked, &dialog, &QDialog::accept); + connect(buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); + connect( + &dialog, &QDialog::accepted, this, [this, iconList] { setupPublicIconButton(iconList->currentIndex().row()); }); + + dialog.exec(); +} + +void DatabaseSettingsWidgetGeneral::setupPublicIconButton(int iconIndex) +{ + auto valid = iconIndex >= 0 && iconIndex < databaseIcons()->count(); + m_ui->dbPublicIconClearButton->setVisible(valid); + if (valid) { + m_ui->dbPublicIconButton->setIcon(databaseIcons()->icon(iconIndex)); + m_ui->dbPublicIconButton->setProperty("iconIndex", iconIndex); + m_ui->dbPublicIconClearButton->setVisible(true); + } else { + m_ui->dbPublicIconButton->setIcon(QIcon()); + m_ui->dbPublicIconButton->setProperty("iconIndex", -1); + m_ui->dbPublicIconClearButton->setVisible(false); + } +} diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.h b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.h index 548490cf0..7c0c1ebe9 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.h +++ b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.h @@ -20,6 +20,8 @@ #include "DatabaseSettingsWidget.h" +#include + class Database; namespace Ui { @@ -43,6 +45,13 @@ public slots: protected: void showEvent(QShowEvent* event) override; +private slots: + void pickPublicColor(); + void setupPublicColorButton(const QColor& color); + void pickPublicIcon(); + void setupPublicIconButton(int iconIndex); + +private: const QScopedPointer m_ui; }; diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui index 939b69963..324ae6d3d 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui +++ b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui @@ -7,7 +7,7 @@ 0 0 453 - 394 + 647 @@ -92,6 +92,151 @@ + + + + Public Database Metadata + + + + + + + true + + + + Warning: the following settings are not encrypted. + + + + + + + 0 + + + + + Display name: + + + + + + + Publically visible display name used on the unlock dialog + + + Database public display name + + + + + + + Display color: + + + + + + + + + + 30 + 30 + + + + Publically visible color used on the unlock dialog + + + Database public display color chooser + + + + + + + + + + Clear + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Display icon: + + + + + + + + + + 30 + 30 + + + + + + + + 30 + 30 + + + + + + + + Clear + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + @@ -113,6 +258,19 @@ of entries remain at most. + + + + Move entries to a recycle bin group +instead of deleting them from the database. +Entries deleted from the recycle bin are +removed from the database. + + + Use recycle bin + + + @@ -158,19 +316,6 @@ add up to the specified amount at most. - - - - Move entries to a recycle bin group -instead of deleting them from the database. -Entries deleted from the recycle bin are -removed from the database. - - - Use recycle bin - - - diff --git a/src/gui/styles/base/basestyle.qss b/src/gui/styles/base/basestyle.qss index ee0fa4e02..8d40281a3 100644 --- a/src/gui/styles/base/basestyle.qss +++ b/src/gui/styles/base/basestyle.qss @@ -38,7 +38,7 @@ EntryPreviewWidget TagsEdit padding-left: 0px; } -DatabaseOpenWidget #centralStack { +DatabaseOpenWidget #centralStack, DatabaseOpenWidget #publicSummaryLabel { border: 1px solid palette(mid); background: palette(light); } diff --git a/src/gui/styles/base/classicstyle.qss b/src/gui/styles/base/classicstyle.qss index d0ab2b88f..72308f39e 100644 --- a/src/gui/styles/base/classicstyle.qss +++ b/src/gui/styles/base/classicstyle.qss @@ -1,4 +1,4 @@ -DatabaseOpenWidget #centralStack { +DatabaseOpenWidget #centralStack, DatabaseOpenWidget #publicSummaryLabel { border: 2px groove palette(mid); background: palette(light); } From 740994ed48dfa4cd927c99b937eaa094475050bd Mon Sep 17 00:00:00 2001 From: Patrick Klein <42714034+libklein@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:42:33 +0100 Subject: [PATCH 2/5] Add option to disable opening a browser window when double-clicking the "URL" column (#11332) --- share/translations/keepassxc_en.ts | 4 ++++ src/core/Config.cpp | 1 + src/core/Config.h | 1 + src/gui/ApplicationSettingsWidget.cpp | 2 ++ src/gui/ApplicationSettingsWidgetGeneral.ui | 17 ++++++++++++++--- src/gui/DatabaseWidget.cpp | 12 +++++++----- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/share/translations/keepassxc_en.ts b/share/translations/keepassxc_en.ts index daaa67606..0ee054f6e 100644 --- a/share/translations/keepassxc_en.ts +++ b/share/translations/keepassxc_en.ts @@ -541,6 +541,10 @@ Export settingsā€¦ + + Open browser on double clicking URL field in entry view + + ApplicationSettingsWidgetSecurity diff --git a/src/core/Config.cpp b/src/core/Config.cpp index a38b307be..108bbe88c 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -66,6 +66,7 @@ static const QHash configStrings = { {Config::UseDirectWriteSaves,{QS("UseDirectWriteSaves"), Local, false}}, {Config::SearchLimitGroup,{QS("SearchLimitGroup"), Roaming, false}}, {Config::MinimizeOnOpenUrl,{QS("MinimizeOnOpenUrl"), Roaming, false}}, + {Config::OpenURLOnDoubleClick, {QS("OpenURLOnDoubleClick"), Roaming, true}}, {Config::HideWindowOnCopy,{QS("HideWindowOnCopy"), Roaming, false}}, {Config::MinimizeOnCopy,{QS("MinimizeOnCopy"), Roaming, true}}, {Config::MinimizeAfterUnlock,{QS("MinimizeAfterUnlock"), Roaming, false}}, diff --git a/src/core/Config.h b/src/core/Config.h index 0f39beafb..5179b49d7 100644 --- a/src/core/Config.h +++ b/src/core/Config.h @@ -49,6 +49,7 @@ public: UseDirectWriteSaves, SearchLimitGroup, MinimizeOnOpenUrl, + OpenURLOnDoubleClick, HideWindowOnCopy, MinimizeOnCopy, MinimizeAfterUnlock, diff --git a/src/gui/ApplicationSettingsWidget.cpp b/src/gui/ApplicationSettingsWidget.cpp index 27f27eb6d..ca7c5fd66 100644 --- a/src/gui/ApplicationSettingsWidget.cpp +++ b/src/gui/ApplicationSettingsWidget.cpp @@ -225,6 +225,7 @@ void ApplicationSettingsWidget::loadSettings() m_generalUi->autoReloadOnChangeCheckBox->setChecked(config()->get(Config::AutoReloadOnChange).toBool()); m_generalUi->minimizeAfterUnlockCheckBox->setChecked(config()->get(Config::MinimizeAfterUnlock).toBool()); m_generalUi->minimizeOnOpenUrlCheckBox->setChecked(config()->get(Config::MinimizeOnOpenUrl).toBool()); + m_generalUi->openUrlOnDoubleClick->setChecked(config()->get(Config::OpenURLOnDoubleClick).toBool()); m_generalUi->hideWindowOnCopyCheckBox->setChecked(config()->get(Config::HideWindowOnCopy).toBool()); hideWindowOnCopyCheckBoxToggled(m_generalUi->hideWindowOnCopyCheckBox->isChecked()); m_generalUi->minimizeOnCopyRadioButton->setChecked(config()->get(Config::MinimizeOnCopy).toBool()); @@ -382,6 +383,7 @@ void ApplicationSettingsWidget::saveSettings() config()->set(Config::AutoReloadOnChange, m_generalUi->autoReloadOnChangeCheckBox->isChecked()); config()->set(Config::MinimizeAfterUnlock, m_generalUi->minimizeAfterUnlockCheckBox->isChecked()); config()->set(Config::MinimizeOnOpenUrl, m_generalUi->minimizeOnOpenUrlCheckBox->isChecked()); + config()->set(Config::OpenURLOnDoubleClick, m_generalUi->openUrlOnDoubleClick->isChecked()); config()->set(Config::HideWindowOnCopy, m_generalUi->hideWindowOnCopyCheckBox->isChecked()); config()->set(Config::MinimizeOnCopy, m_generalUi->minimizeOnCopyRadioButton->isChecked()); config()->set(Config::DropToBackgroundOnCopy, m_generalUi->dropToBackgroundOnCopyRadioButton->isChecked()); diff --git a/src/gui/ApplicationSettingsWidgetGeneral.ui b/src/gui/ApplicationSettingsWidgetGeneral.ui index 6e74205ff..25a993b23 100644 --- a/src/gui/ApplicationSettingsWidgetGeneral.ui +++ b/src/gui/ApplicationSettingsWidgetGeneral.ui @@ -57,9 +57,9 @@ 0 - 0 - 568 - 1153 + -419 + 573 + 1397 @@ -543,6 +543,16 @@ + + + + Open browser on double clicking URL field in entry view + + + true + + + @@ -1351,6 +1361,7 @@ alternativeSaveComboBox ConfirmMoveEntryToRecycleBinCheckBox EnableCopyOnDoubleClickCheckBox + openUrlOnDoubleClick useGroupIconOnEntryCreationCheckBox minimizeOnOpenUrlCheckBox hideWindowOnCopyCheckBox diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 8ec29b951..c10636289 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -1495,11 +1495,6 @@ void DatabaseWidget::entryActivationSignalReceived(Entry* entry, EntryModel::Mod switchToEntryEdit(entry); } break; - case EntryModel::Url: - if (!entry->url().isEmpty()) { - openUrlForEntry(entry); - } - break; case EntryModel::Totp: if (entry->hasTotp()) { setClipboardTextAndMinimize(entry->totp()); @@ -1520,6 +1515,13 @@ void DatabaseWidget::entryActivationSignalReceived(Entry* entry, EntryModel::Mod // TODO: switch to 'Attachments' tab in details view/pane // case EntryModel::Attachments: // break; + case EntryModel::Url: + if (!entry->url().isEmpty() && config()->get(Config::OpenURLOnDoubleClick).toBool()) { + openUrlForEntry(entry); + break; + } + // Note, order matters here. We want to fall into the default case. + [[fallthrough]]; default: switchToEntryEdit(entry); } From d57d167e9c221695c1a5e423a50270283dc37846 Mon Sep 17 00:00:00 2001 From: xboxones1 <91512529+xboxones1@users.noreply.github.com> Date: Wed, 18 Sep 2024 03:23:32 +0000 Subject: [PATCH 3/5] Dark theme fix colors for qmenu --- src/gui/styles/dark/darkstyle.qss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/styles/dark/darkstyle.qss b/src/gui/styles/dark/darkstyle.qss index 23bcfd927..92d00fb00 100644 --- a/src/gui/styles/dark/darkstyle.qss +++ b/src/gui/styles/dark/darkstyle.qss @@ -10,6 +10,15 @@ EntryPreviewWidget TagsEdit:disabled { background-color: #424242; } +QMenu { + border: 1px solid #56565A; +} + +QMenu::separator { + height: 1px; + background-color: #56565A; +} + QPushButton:!default:hover { /* Using slightly darker shade from palette(button) */ background: #252528; From 02881889d5b3dc533b8afafa47c0b0ac8054f2c1 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 11 Oct 2024 17:32:49 -0400 Subject: [PATCH 4/5] Fix entry notes reveal button requiring two clicks sometimes --- src/gui/entry/EditEntryWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index 6825a08be..8b29333d0 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -913,6 +913,7 @@ void EditEntryWidget::setForms(Entry* entry, bool restore) m_mainUi->expireDatePicker->setReadOnly(m_history); m_mainUi->revealNotesButton->setIcon(icons()->onOffIcon("password-show", false)); m_mainUi->revealNotesButton->setVisible(config()->get(Config::Security_HideNotes).toBool()); + m_mainUi->revealNotesButton->setChecked(false); m_mainUi->notesEdit->setReadOnly(m_history); m_mainUi->notesEdit->setVisible(!config()->get(Config::Security_HideNotes).toBool()); if (config()->get(Config::GUI_MonospaceNotes).toBool()) { From 4f8c20409628f7cedba7f67ff398a1158c1d0d6f Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 15 Oct 2024 07:49:01 -0400 Subject: [PATCH 5/5] Avoid hitting assert on XML export * Fixes #11365 --- src/format/KdbxWriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/format/KdbxWriter.cpp b/src/format/KdbxWriter.cpp index b7758c751..1e4923934 100644 --- a/src/format/KdbxWriter.cpp +++ b/src/format/KdbxWriter.cpp @@ -71,7 +71,8 @@ void KdbxWriter::extractDatabase(QByteArray& xmlOutput, Database* db) QBuffer buffer; buffer.setBuffer(&xmlOutput); buffer.open(QIODevice::WriteOnly); - KdbxXmlWriter writer(db->formatVersion()); + KdbxXmlWriter::BinaryIdxMap idxMap; + KdbxXmlWriter writer(db->formatVersion(), idxMap); writer.disableInnerStreamProtection(true); writer.writeDatabase(&buffer, db); }