diff --git a/src/gui/formsettings.cpp b/src/gui/formsettings.cpp
index a5197b98a..6389f8155 100755
--- a/src/gui/formsettings.cpp
+++ b/src/gui/formsettings.cpp
@@ -171,6 +171,7 @@ void FormSettings::selectBrowserExecutable() {
}
void FormSettings::loadFeedsMessages() {
+ m_ui->m_checkKeppMessagesInTheMiddle->setChecked(Settings::instance()->value(APP_CFG_MESSAGES, "keep_cursor_center", false).toBool());
m_ui->m_checkRemoveReadMessagesOnExit->setChecked(Settings::instance()->value(APP_CFG_MESSAGES, "clear_read_on_exit", false).toBool());
m_ui->m_checkAutoUpdate->setChecked(Settings::instance()->value(APP_CFG_FEEDS, "auto_update_enabled", false).toBool());
m_ui->m_spinAutoUpdateInterval->setValue(Settings::instance()->value(APP_CFG_FEEDS, "auto_update_interval", DEFAULT_AUTO_UPDATE_INTERVAL).toInt());
@@ -179,6 +180,7 @@ void FormSettings::loadFeedsMessages() {
}
void FormSettings::saveFeedsMessages() {
+ Settings::instance()->setValue(APP_CFG_MESSAGES, "keep_cursor_center", m_ui->m_checkKeppMessagesInTheMiddle->isChecked());
Settings::instance()->setValue(APP_CFG_MESSAGES, "clear_read_on_exit", m_ui->m_checkRemoveReadMessagesOnExit->isChecked());
Settings::instance()->setValue(APP_CFG_FEEDS, "auto_update_enabled", m_ui->m_checkAutoUpdate->isChecked());
Settings::instance()->setValue(APP_CFG_FEEDS, "auto_update_interval", m_ui->m_spinAutoUpdateInterval->value());
diff --git a/src/gui/formsettings.ui b/src/gui/formsettings.ui
index 817308581..c5ca9f8f4 100644
--- a/src/gui/formsettings.ui
+++ b/src/gui/formsettings.ui
@@ -17,11 +17,20 @@
-
- 0
+ 6
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -35,7 +44,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -71,7 +89,16 @@
QFormLayout::AllNonFixedFieldsGrow
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -111,7 +138,16 @@ Authors of this application are NOT responsible for lost data.
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -225,7 +261,16 @@ Authors of this application are NOT responsible for lost data.
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -241,12 +286,21 @@ Authors of this application are NOT responsible for lost data.
0
0
- 576
- 373
+ 100
+ 30
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -260,7 +314,16 @@ Authors of this application are NOT responsible for lost data.
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -276,7 +339,16 @@ Authors of this application are NOT responsible for lost data.
Icons && skins
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -292,8 +364,8 @@ Authors of this application are NOT responsible for lost data.
0
0
- 568
- 344
+ 209
+ 245
@@ -508,7 +580,16 @@ Authors of this application are NOT responsible for lost data.
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -537,7 +618,16 @@ Authors of this application are NOT responsible for lost data.
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -847,7 +937,16 @@ Authors of this application are NOT responsible for lost data.
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -860,6 +959,16 @@ Authors of this application are NOT responsible for lost data.
Feeds
+
+ QFormLayout::AllNonFixedFieldsGrow
+
+
-
+
+
+ Update all feed on application startup
+
+
+
-
@@ -912,13 +1021,6 @@ Authors of this application are NOT responsible for lost data.
- -
-
-
- Update all feed on application startup
-
-
-
@@ -936,6 +1038,13 @@ Authors of this application are NOT responsible for lost data.
+ -
+
+
+ Kepp message selection in the middle of the message list viewport
+
+
+
diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp
index d79009aac..dbe3894fa 100644
--- a/src/gui/messagesview.cpp
+++ b/src/gui/messagesview.cpp
@@ -197,30 +197,11 @@ void MessagesView::currentChanged(const QModelIndex ¤t,
void MessagesView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected) {
-// QModelIndex current_index = currentIndex();
-// QModelIndex mapped_current_index = m_proxyModel->mapToSource(current_index);
-
-// qDebug("Current row changed - row [%d,%d] source [%d, %d].",
-// current_index.row(), current_index.column(),
-// mapped_current_index.row(), mapped_current_index.column());
-
-// if (mapped_current_index.isValid()) {
-// if (!m_batchUnreadSwitch) {
-// // Set this message as read only if current item
-// // wasn't changed by "mark selected messages unread" action.
-// m_sourceModel->setMessageRead(mapped_current_index.row(), 1);
-// }
-
-// emit currentMessagesChanged(QList() <<
-// m_sourceModel->messageAt(mapped_current_index.row()));
-// }
-// else {
-// emit currentMessagesRemoved();
-// }
-
- // TODO: This fixes bug #13 + possibly
- // move code from currentChanged to this method too.
- //scrollTo(current_index, QAbstractItemView::PositionAtCenter);
+ if (Settings::instance()->value(APP_CFG_MESSAGES,
+ "keep_cursor_center",
+ false).toBool()) {
+ scrollTo(currentIndex(), QAbstractItemView::PositionAtCenter);
+ }
QTreeView::selectionChanged(selected, deselected);
}