From 7e6f4ed4464210a500c76170701ead381ab7e57f Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 18 Jul 2017 06:48:37 +0200 Subject: [PATCH] Move to next/previous feed shortcuts are now recursive. --- src/gui/feedsview.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index f8f64e9ef..07b8542a4 100755 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -328,7 +328,13 @@ void FeedsView::openSelectedItemsInNewspaperMode() { } void FeedsView::selectNextItem() { - const QModelIndex index_next = moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier); + const QModelIndex &curr_idx = currentIndex(); + + if (m_proxyModel->hasChildren(curr_idx) && !isExpanded(curr_idx)) { + expand(curr_idx); + } + + const QModelIndex &index_next = moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier); if (index_next.isValid()) { setCurrentIndex(index_next); @@ -337,7 +343,13 @@ void FeedsView::selectNextItem() { } void FeedsView::selectPreviousItem() { - const QModelIndex index_previous = moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier); + const QModelIndex &curr_idx = currentIndex(); + + if (m_proxyModel->hasChildren(curr_idx) && !isExpanded(curr_idx)) { + expand(curr_idx); + } + + const QModelIndex &index_previous = moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier); if (index_previous.isValid()) { setCurrentIndex(index_previous);