respect auto-expand policy when moving around with select next/previous item shortcuts in feeds list

This commit is contained in:
Martin Rotter 2021-09-27 10:29:13 +02:00
parent 94454dfc04
commit a87e09d49a

View File

@ -369,11 +369,6 @@ void FeedsView::openSelectedItemsInNewspaperMode() {
void FeedsView::selectNextItem() {
QModelIndex index_next = moveCursor(QAbstractItemView::CursorAction::MoveDown, Qt::KeyboardModifier::NoModifier);
while (m_proxyModel->hasChildren(index_next) && !isExpanded(index_next)) {
expand(index_next);
index_next = moveCursor(QAbstractItemView::CursorAction::MoveDown, Qt::KeyboardModifier::NoModifier);
}
if (index_next.isValid()) {
setCurrentIndex(index_next);
scrollTo(index_next, QAbstractItemView::ScrollHint::EnsureVisible);
@ -385,11 +380,6 @@ void FeedsView::selectNextItem() {
void FeedsView::selectPreviousItem() {
QModelIndex index_previous = moveCursor(QAbstractItemView::CursorAction::MoveUp, Qt::KeyboardModifier::NoModifier);
while (m_proxyModel->hasChildren(index_previous) && !isExpanded(index_previous)) {
expand(index_previous);
index_previous = moveCursor(QAbstractItemView::CursorAction::MoveUp, Qt::KeyboardModifier::NoModifier);
}
if (index_previous.isValid()) {
setCurrentIndex(index_previous);
scrollTo(index_previous, QAbstractItemView::ScrollHint::EnsureVisible);