mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-28 08:09:42 +01:00
fixxx #435
This commit is contained in:
parent
c9674c8a47
commit
22c24fe988
@ -537,7 +537,12 @@ void MessagesView::selectNextItem() {
|
|||||||
|
|
||||||
if (index_next.isValid()) {
|
if (index_next.isValid()) {
|
||||||
setCurrentIndex(index_next);
|
setCurrentIndex(index_next);
|
||||||
scrollTo(index_next, QAbstractItemView::ScrollHint::PositionAtTop);
|
|
||||||
|
scrollTo(index_next,
|
||||||
|
!m_processingMouse && qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()
|
||||||
|
? QAbstractItemView::ScrollHint::PositionAtCenter
|
||||||
|
: QAbstractItemView::ScrollHint::PositionAtTop);
|
||||||
|
|
||||||
selectionModel()->select(index_next, QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
selectionModel()->select(index_next, QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
@ -548,7 +553,12 @@ void MessagesView::selectPreviousItem() {
|
|||||||
|
|
||||||
if (index_previous.isValid()) {
|
if (index_previous.isValid()) {
|
||||||
setCurrentIndex(index_previous);
|
setCurrentIndex(index_previous);
|
||||||
scrollTo(index_previous, QAbstractItemView::ScrollHint::PositionAtTop);
|
|
||||||
|
scrollTo(index_previous,
|
||||||
|
!m_processingMouse && qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()
|
||||||
|
? QAbstractItemView::ScrollHint::PositionAtCenter
|
||||||
|
: QAbstractItemView::ScrollHint::PositionAtTop);
|
||||||
|
|
||||||
selectionModel()->select(index_previous, QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
selectionModel()->select(index_previous, QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
@ -579,7 +589,11 @@ void MessagesView::selectNextUnreadItem() {
|
|||||||
// Make sure that item is properly visible even if
|
// Make sure that item is properly visible even if
|
||||||
// message previewer was hidden and shows up.
|
// message previewer was hidden and shows up.
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
scrollTo(next_unread, QAbstractItemView::ScrollHint::PositionAtTop);
|
|
||||||
|
scrollTo(next_unread,
|
||||||
|
!m_processingMouse && qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()
|
||||||
|
? QAbstractItemView::ScrollHint::PositionAtCenter
|
||||||
|
: QAbstractItemView::ScrollHint::PositionAtTop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,7 +609,10 @@ void MessagesView::searchMessages(const QString& pattern) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Scroll to selected message, it could become scrolled out due to filter change.
|
// Scroll to selected message, it could become scrolled out due to filter change.
|
||||||
scrollTo(selectionModel()->selectedRows().at(0));
|
scrollTo(selectionModel()->selectedRows().at(0),
|
||||||
|
!m_processingMouse && qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()
|
||||||
|
? QAbstractItemView::ScrollHint::PositionAtCenter
|
||||||
|
: QAbstractItemView::ScrollHint::EnsureVisible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user