From 525d5de30c5ca817c1d8510754659d66b27c139a Mon Sep 17 00:00:00 2001 From: Weslly Date: Sun, 26 Nov 2017 22:23:15 -0200 Subject: [PATCH 1/2] Remove empty context menu from toolbar --- src/gui/MainWindow.cpp | 7 ++----- src/gui/MainWindow.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 30bb2cdf3d..fa16adb80f 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -114,6 +114,8 @@ MainWindow::MainWindow() { m_ui->setupUi(this); + m_ui->toolBar->setContextMenuPolicy(Qt::PreventContextMenu); + // Setup the search widget in the toolbar SearchWidget *search = new SearchWidget(); search->connectSignals(m_actionMultiplexer); @@ -822,11 +824,6 @@ void MainWindow::showGroupContextMenu(const QPoint& globalPos) m_ui->menuGroups->popup(globalPos); } -void MainWindow::saveToolbarState(bool value) -{ - config()->set("ShowToolbar", value); -} - void MainWindow::setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback) { if (!QKeySequence::keyBindings(standard).isEmpty()) { diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index ea17107ad2..ade339c565 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -87,7 +87,6 @@ private slots: void updateCopyAttributesMenu(); void showEntryContextMenu(const QPoint& globalPos); void showGroupContextMenu(const QPoint& globalPos); - void saveToolbarState(bool value); void rememberOpenDatabases(const QString& filePath); void applySettingsChanges(); void trayIconTriggered(QSystemTrayIcon::ActivationReason reason); From 5fa76dfd66e90b5efb4a4a159c034ea130e89059 Mon Sep 17 00:00:00 2001 From: Weslly Date: Sun, 26 Nov 2017 22:59:48 -0200 Subject: [PATCH 2/2] Remove `ShowToolbar` from config --- share/keepassxc.ini | 1 - src/core/Config.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/share/keepassxc.ini b/share/keepassxc.ini index f7ff52cbc0..c6f0654fe0 100644 --- a/share/keepassxc.ini +++ b/share/keepassxc.ini @@ -1,5 +1,4 @@ [General] -ShowToolbar=true RememberLastDatabases=true RememberLastKeyFiles=true OpenPreviousDatabasesOnStartup=true diff --git a/src/core/Config.cpp b/src/core/Config.cpp index 6899015a61..2047919b11 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -114,7 +114,6 @@ void Config::init(const QString& fileName) m_defaults.insert("AutoSaveAfterEveryChange", false); m_defaults.insert("AutoReloadOnChange", true); m_defaults.insert("AutoSaveOnExit", false); - m_defaults.insert("ShowToolbar", true); m_defaults.insert("SearchLimitGroup", false); m_defaults.insert("MinimizeOnCopy", false); m_defaults.insert("UseGroupIconOnEntryCreation", false);