remove "current" index after selection is cleared
This commit is contained in:
parent
0c2943e85e
commit
4854a67195
1 changed files with 5 additions and 1 deletions
|
@ -410,7 +410,7 @@ void MessagesView::selectionChanged(const QItemSelection& selected, const QItemS
|
||||||
<< current_index << "', source '"
|
<< current_index << "', source '"
|
||||||
<< mapped_current_index << "'.";
|
<< mapped_current_index << "'.";
|
||||||
|
|
||||||
if (mapped_current_index.isValid() && selected_rows.count() == 1) {
|
if (mapped_current_index.isValid() && selected_rows.size() == 1) {
|
||||||
Message message = m_sourceModel->messageAt(m_proxyModel->mapToSource(current_index).row());
|
Message message = m_sourceModel->messageAt(m_proxyModel->mapToSource(current_index).row());
|
||||||
|
|
||||||
// Set this message as read only if current item
|
// Set this message as read only if current item
|
||||||
|
@ -424,6 +424,10 @@ void MessagesView::selectionChanged(const QItemSelection& selected, const QItemS
|
||||||
emit currentMessageRemoved();
|
emit currentMessageRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selected_rows.isEmpty()) {
|
||||||
|
setCurrentIndex({});
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_processingMouse &&
|
if (!m_processingMouse &&
|
||||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()) {
|
qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()) {
|
||||||
scrollTo(currentIndex(), QAbstractItemView::ScrollHint::PositionAtCenter);
|
scrollTo(currentIndex(), QAbstractItemView::ScrollHint::PositionAtCenter);
|
||||||
|
|
Loading…
Add table
Reference in a new issue