diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index e7e32d160..9402096c6 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -10,7 +10,7 @@ Fixed:
Added:
-- Added option to hide main toolbars.
+- Added option to hide main toolbars and feed/message list headers.
- "Defragment database" button shortcut is now changeable.
- Added option to clear keyboard shortcuts.
- Added "progress bar" to web browser.
diff --git a/src/dynamic-shortcuts/shortcutbutton.cpp b/src/dynamic-shortcuts/shortcutbutton.cpp
index e05501c9a..b4136473f 100644
--- a/src/dynamic-shortcuts/shortcutbutton.cpp
+++ b/src/dynamic-shortcuts/shortcutbutton.cpp
@@ -48,7 +48,7 @@ void ShortcutButton::keyPressEvent(QKeyEvent *event) {
}
Qt::KeyboardModifiers new_modifiers = event->modifiers() &
- (Qt::SHIFT | Qt::CTRL | Qt::ALT | Qt::META);
+ (Qt::SHIFT | Qt::CTRL | Qt::ALT | Qt::META);
if (!m_catcher->m_isRecording && (pressed_key == Qt::Key_Return || pressed_key == Qt::Key_Space)) {
return;
@@ -106,14 +106,14 @@ void ShortcutButton::keyReleaseEvent(QKeyEvent *event) {
return;
}
- if (m_catcher->m_isRecording == false) {
+ if (!m_catcher->m_isRecording) {
return QPushButton::keyReleaseEvent(event);
}
event->accept();
Qt::KeyboardModifiers new_modifiers = event->modifiers() &
- (Qt::SHIFT | Qt::CTRL | Qt::ALT | Qt::META);
+ (Qt::SHIFT | Qt::CTRL | Qt::ALT | Qt::META);
if (((uint) new_modifiers & m_catcher->m_modifierKeys) < m_catcher->m_modifierKeys) {
m_catcher->m_modifierKeys = new_modifiers;
diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp
index e71e224d4..c6b13124f 100644
--- a/src/gui/feedmessageviewer.cpp
+++ b/src/gui/feedmessageviewer.cpp
@@ -50,6 +50,7 @@
FeedMessageViewer::FeedMessageViewer(QWidget *parent)
: TabContent(parent),
m_toolBarsEnabled(true),
+ m_listHeadersEnabled(true),
m_toolBarFeeds(new QToolBar(tr("Toolbar for feeds"), this)),
m_toolBarMessages(new QToolBar(tr("Toolbar for messages"), this)),
m_messagesView(new MessagesView(this)),
@@ -99,8 +100,9 @@ void FeedMessageViewer::saveSize() {
width_column_date);
}
- // Store "visibility" of toolbars.
+ // Store "visibility" of toolbars and list headers.
settings->setValue(APP_CFG_GUI, "enable_toolbars", m_toolBarsEnabled);
+ settings->setValue(APP_CFG_GUI, "enable_list_headers", m_listHeadersEnabled);
}
void FeedMessageViewer::loadSize() {
@@ -142,6 +144,12 @@ void FeedMessageViewer::setToolBarsEnabled(bool enable) {
m_toolBarMessages->setVisible(enable);
}
+void FeedMessageViewer::setListHeadersEnabled(bool enable) {
+ m_listHeadersEnabled = enable;
+ m_feedsView->header()->setVisible(enable);
+ m_messagesView->header()->setVisible(enable);
+}
+
void FeedMessageViewer::updateTrayIconStatus(int unread_messages,
int total_messages) {
Q_UNUSED(total_messages)
@@ -275,6 +283,8 @@ void FeedMessageViewer::createConnections() {
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_actionSwitchListHeaders,
+ SIGNAL(toggled(bool)), this, SLOT(setListHeadersEnabled(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 af449b38b..093db5eb6 100644
--- a/src/gui/feedmessageviewer.h
+++ b/src/gui/feedmessageviewer.h
@@ -64,9 +64,14 @@ class FeedMessageViewer : public TabContent {
return m_toolBarsEnabled;
}
+ inline bool areListHeadersEnabled() const {
+ return m_listHeadersEnabled;
+ }
+
public slots:
- // Enables/disables main toolbars.
+ // Enables/disables main toolbars or list headers.
void setToolBarsEnabled(bool enable);
+ void setListHeadersEnabled(bool enable);
// Runs "cleanup" of the database.
void vacuumDatabase();
@@ -99,6 +104,7 @@ class FeedMessageViewer : public TabContent {
private:
bool m_toolBarsEnabled;
+ bool m_listHeadersEnabled;
QToolBar *m_toolBarFeeds;
QToolBar *m_toolBarMessages;
diff --git a/src/gui/formmain.cpp b/src/gui/formmain.cpp
index cf3fea484..2147de623 100755
--- a/src/gui/formmain.cpp
+++ b/src/gui/formmain.cpp
@@ -92,7 +92,8 @@ 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_actionSwitchToolBars;
+ m_ui->m_actionSwitchMainMenu << m_ui->m_actionSwitchToolBars <<
+ m_ui->m_actionSwitchListHeaders;
// Add web browser actions
actions << m_ui->m_actionAddBrowser << m_ui->m_actionCloseCurrentTab <<
@@ -272,6 +273,7 @@ void FormMain::setupIcons() {
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_actionSwitchListHeaders->setIcon(icon_theme_factory->fromTheme("view-switch-list"));
m_ui->m_menuShowHide->setIcon(icon_theme_factory->fromTheme("view-switch"));
// Web browser.
@@ -341,6 +343,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());
+ m_ui->m_actionSwitchListHeaders->setChecked(settings->value(APP_CFG_GUI, "enable_list_headers", true).toBool());
}
void FormMain::saveSize() {
diff --git a/src/gui/formmain.ui b/src/gui/formmain.ui
index 36313002a..5f22b87f0 100644
--- a/src/gui/formmain.ui
+++ b/src/gui/formmain.ui
@@ -77,6 +77,7 @@
+
@@ -515,6 +516,20 @@
T
+
+
+ true
+
+
+ true
+
+
+ &Feed/message list headers
+
+
+ H
+
+