From ddc4b9b7d548c6b753a7f161085990bdac7e88c6 Mon Sep 17 00:00:00 2001 From: Vladimir Svyatski Date: Fri, 6 Apr 2018 23:23:52 +0300 Subject: [PATCH 1/5] Remove empty context menu from the main menu --- src/gui/MainWindow.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index 648a0e61a..49c0a6f3b 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -175,6 +175,9 @@ + + Qt::PreventContextMenu + &Database From 677b8caa63964e9891585d5594a3a33b276de610 Mon Sep 17 00:00:00 2001 From: Vladimir Svyatski Date: Mon, 9 Apr 2018 21:09:31 +0300 Subject: [PATCH 2/5] Add UI setting "Hide toolbar (icons)" --- src/gui/SettingsWidget.cpp | 2 ++ src/gui/SettingsWidgetGeneral.ui | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index be2f4cd44..b16356d8b 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -140,6 +140,7 @@ void SettingsWidget::loadSettings() } m_generalUi->detailsHideCheckBox->setChecked(config()->get("GUI/HideDetailsView").toBool()); + m_generalUi->toolbarHideCheckBox->setChecked(config()->get("GUI/HideToolbar").toBool()); m_generalUi->systrayShowCheckBox->setChecked(config()->get("GUI/ShowTrayIcon").toBool()); m_generalUi->systrayDarkIconCheckBox->setChecked(config()->get("GUI/DarkTrayIcon").toBool()); m_generalUi->systrayMinimizeToTrayCheckBox->setChecked(config()->get("GUI/MinimizeToTray").toBool()); @@ -209,6 +210,7 @@ void SettingsWidget::saveSettings() config()->set("GUI/Language", m_generalUi->languageComboBox->itemData(currentLangIndex).toString()); config()->set("GUI/HideDetailsView", m_generalUi->detailsHideCheckBox->isChecked()); + config()->set("GUI/HideToolbar", m_generalUi->toolbarHideCheckBox->isChecked()); config()->set("GUI/ShowTrayIcon", m_generalUi->systrayShowCheckBox->isChecked()); config()->set("GUI/DarkTrayIcon", m_generalUi->systrayDarkIconCheckBox->isChecked()); config()->set("GUI/MinimizeToTray", m_generalUi->systrayMinimizeToTrayCheckBox->isChecked()); diff --git a/src/gui/SettingsWidgetGeneral.ui b/src/gui/SettingsWidgetGeneral.ui index 5ed952f1f..d7535f6e5 100644 --- a/src/gui/SettingsWidgetGeneral.ui +++ b/src/gui/SettingsWidgetGeneral.ui @@ -7,7 +7,7 @@ 0 0 684 - 732 + 794 @@ -179,6 +179,13 @@ General + + + + Hide toolbar (icons) + + + From d843ad414a6a0ab26c27c5d37f883d7efdcccbae Mon Sep 17 00:00:00 2001 From: Vladimir Svyatski Date: Mon, 9 Apr 2018 22:06:48 +0300 Subject: [PATCH 3/5] Use the "Hide toolbar" setting --- src/gui/MainWindow.cpp | 2 +- src/gui/MainWindow.ui | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 95bdd3fa0..8f7caa7c3 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -133,7 +133,7 @@ MainWindow::MainWindow() setAcceptDrops(true); - m_ui->toolBar->setContextMenuPolicy(Qt::PreventContextMenu); + m_ui->toolBar->setHidden(config()->get("GUI/HideToolbar").toBool()); // Setup the search widget in the toolbar SearchWidget* search = new SearchWidget(); diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index 49c0a6f3b..b67e6ffd1 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -175,6 +175,14 @@ + + + 0 + 0 + 800 + 30 + + Qt::PreventContextMenu @@ -280,6 +288,9 @@ + + Qt::PreventContextMenu + false From 57860fc33cc911f2dced683dfa25effe30aa1a37 Mon Sep 17 00:00:00 2001 From: Vladimir Svyatski Date: Mon, 9 Apr 2018 22:33:08 +0300 Subject: [PATCH 4/5] Fix to apply "Hide toolbar" without restart --- src/gui/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 8f7caa7c3..8cdff237f 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -133,8 +133,6 @@ MainWindow::MainWindow() setAcceptDrops(true); - m_ui->toolBar->setHidden(config()->get("GUI/HideToolbar").toBool()); - // Setup the search widget in the toolbar SearchWidget* search = new SearchWidget(); search->connectSignals(m_actionMultiplexer); @@ -841,6 +839,8 @@ void MainWindow::applySettingsChanges() m_inactivityTimer->deactivate(); } + m_ui->toolBar->setHidden(config()->get("GUI/HideToolbar").toBool()); + updateTrayIcon(); } From bbfac926729cd1abb68eb1f5046788be0a16c073 Mon Sep 17 00:00:00 2001 From: Vladimir Svyatski Date: Tue, 10 Apr 2018 08:27:23 +0300 Subject: [PATCH 5/5] Add requested changes to PR #1819. --- src/core/Config.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/Config.cpp b/src/core/Config.cpp index ccdc24fd1..6719e37d4 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -149,6 +149,7 @@ void Config::init(const QString& fileName) m_defaults.insert("security/autotypeask", true); m_defaults.insert("security/IconDownloadFallbackToGoogle", false); m_defaults.insert("GUI/Language", "system"); + m_defaults.insert("GUI/HideToolbar", false); m_defaults.insert("GUI/ShowTrayIcon", false); m_defaults.insert("GUI/DarkTrayIcon", false); m_defaults.insert("GUI/MinimizeToTray", false);