Enhanced select next/prev item.

This commit is contained in:
Martin Rotter 2018-04-03 11:16:46 +02:00
parent 50af26fa9a
commit 6baafd0c66
3 changed files with 29 additions and 22 deletions

@ -1 +1 @@
Subproject commit ae7084718c41afc01919779e58cd449e0eebd401
Subproject commit 4a01edaec7d67d3b2ae81aeea2a3c876216fbab8

View File

@ -1,7 +1,14 @@
3.5.6
—————
Changed:
▪ Enhanced behavior of "Select next/previous item" in feed's list.
3.5.6
—————
Fixed:
▪ Some minor stuff fixes.
▪ Unnecessary "Welcome" notifications. (bug #176)
▪ Bad handling of null/empty strings when inserting messages into DB. (bug #169)
▪ Bad conversion of "created on" date/time in TT-RSS plugin. (bug #172)

View File

@ -311,33 +311,33 @@ void FeedsView::openSelectedItemsInNewspaperMode() {
}
void FeedsView::selectNextItem() {
const QModelIndex& curr_idx = currentIndex();
QModelIndex index_previous = moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier);
if (m_proxyModel->hasChildren(curr_idx) && !isExpanded(curr_idx)) {
expand(curr_idx);
while (m_proxyModel->hasChildren(index_previous) && !isExpanded(index_previous)) {
expand(index_previous);
index_previous = moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier);
}
const QModelIndex& index_next = moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier);
if (index_next.isValid()) {
setCurrentIndex(index_next);
setFocus();
}
}
void FeedsView::selectPreviousItem() {
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);
setFocus();
}
setFocus();
}
void FeedsView::selectPreviousItem() {
QModelIndex index_previous = moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier);
while (m_proxyModel->hasChildren(index_previous) && !isExpanded(index_previous)) {
expand(index_previous);
index_previous = moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier);
}
if (index_previous.isValid()) {
setCurrentIndex(index_previous);
}
setFocus();
}
void FeedsView::selectNextUnreadItem() {