diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index c7cbc7353..e7e32d160 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -10,6 +10,7 @@ Fixed:
Added:
+- Added option to hide main toolbars.
- "Defragment database" button shortcut is now changeable.
- Added option to clear keyboard shortcuts.
- Added "progress bar" to web browser.
diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp
index 2f1c8876b..1994eed7a 100644
--- a/src/gui/feedmessageviewer.cpp
+++ b/src/gui/feedmessageviewer.cpp
@@ -97,6 +97,9 @@ void FeedMessageViewer::saveSize() {
KEY_MESSAGES_VIEW + QString::number(MSG_DB_DCREATED_INDEX),
width_column_date);
}
+
+ // Store "visibility" of toolbars.
+ settings->setValue(APP_CFG_GUI, "enable_toolbars", m_toolBarsEnabled);
}
void FeedMessageViewer::loadSize() {
@@ -132,6 +135,12 @@ void FeedMessageViewer::quit() {
m_feedDownloader->deleteLater();
}
+void FeedMessageViewer::setToolBarsEnabled(bool enable) {
+ m_toolBarsEnabled = enable;
+ m_toolBarFeeds->setVisible(enable);
+ m_toolBarMessages->setVisible(enable);
+}
+
void FeedMessageViewer::updateTrayIconStatus(int unread_messages,
int total_messages) {
Q_UNUSED(total_messages)
@@ -263,6 +272,8 @@ void FeedMessageViewer::createConnections() {
SIGNAL(triggered()), this, SLOT(switchFeedComponentVisibility()));
connect(form_main->m_ui->m_actionSelectNextFeedCategory,
SIGNAL(triggered()), m_feedsView, SLOT(selectNextItem()));
+ connect(form_main->m_ui->m_actionSwitchToolBars,
+ SIGNAL(toggled(bool)), this, SLOT(setToolBarsEnabled(bool)));
connect(form_main->m_ui->m_actionSelectPreviousFeedCategory,
SIGNAL(triggered()), m_feedsView, SLOT(selectPreviousItem()));
connect(form_main->m_ui->m_actionSelectNextMessage,
diff --git a/src/gui/feedmessageviewer.h b/src/gui/feedmessageviewer.h
index 5e1adcb25..af449b38b 100644
--- a/src/gui/feedmessageviewer.h
+++ b/src/gui/feedmessageviewer.h
@@ -60,7 +60,14 @@ class FeedMessageViewer : public TabContent {
// stops any child widgets/workers.
void quit();
+ inline bool areToolBarsEnabled() const {
+ return m_toolBarsEnabled;
+ }
+
public slots:
+ // Enables/disables main toolbars.
+ void setToolBarsEnabled(bool enable);
+
// Runs "cleanup" of the database.
void vacuumDatabase();
@@ -91,6 +98,7 @@ class FeedMessageViewer : public TabContent {
void createConnections();
private:
+ bool m_toolBarsEnabled;
QToolBar *m_toolBarFeeds;
QToolBar *m_toolBarMessages;
diff --git a/src/gui/formmain.cpp b/src/gui/formmain.cpp
index 1ae1edecd..34a5793f4 100755
--- a/src/gui/formmain.cpp
+++ b/src/gui/formmain.cpp
@@ -92,7 +92,7 @@ QList FormMain::allActions() {
actions << m_ui->m_actionSettings << m_ui->m_actionQuit <<
m_ui->m_actionFullscreen << m_ui->m_actionAboutGuard <<
m_ui->m_actionSwitchFeedsList << m_ui->m_actionSwitchMainWindow <<
- m_ui->m_actionSwitchMainMenu;
+ m_ui->m_actionSwitchMainMenu << m_ui->m_actionSwitchToolBars;
// Add web browser actions
actions << m_ui->m_actionAddBrowser << m_ui->m_actionCloseCurrentTab <<
@@ -271,6 +271,7 @@ void FormMain::setupIcons() {
m_ui->m_actionFullscreen->setIcon(icon_theme_factory->fromTheme("view-fullscreen"));
m_ui->m_actionSwitchFeedsList->setIcon(icon_theme_factory->fromTheme("view-switch-list"));
m_ui->m_actionSwitchMainMenu->setIcon(icon_theme_factory->fromTheme("view-switch-menu"));
+ m_ui->m_actionSwitchToolBars->setIcon(icon_theme_factory->fromTheme("view-switch-list"));
m_ui->m_menuShowHide->setIcon(icon_theme_factory->fromTheme("view-switch"));
// Web browser.
@@ -339,6 +340,7 @@ void FormMain::loadSize() {
// Adjust dimensions of "feeds & messages" widget.
m_ui->m_tabWidget->feedMessageViewer()->loadSize();
+ m_ui->m_actionSwitchToolBars->setChecked(settings->value(APP_CFG_GUI, "enable_toolbars", true).toBool());
}
void FormMain::saveSize() {
diff --git a/src/gui/formmain.ui b/src/gui/formmain.ui
index 388b64179..36313002a 100644
--- a/src/gui/formmain.ui
+++ b/src/gui/formmain.ui
@@ -76,6 +76,7 @@
+
@@ -497,6 +498,23 @@
Report a &bug...
+
+
+ true
+
+
+ true
+
+
+ &Toolbars
+
+
+ Switch visibility of main toolbars.
+
+
+ T
+
+