Dive list: expand trips if dives are selected

If dives are deleted, the trip(s) containing the dives are expanded.
Thus, on undo it seems natural to re-expand the trip.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-08-13 10:20:55 -04:00 committed by Dirk Hohndel
parent 2a61664ceb
commit b16be29595

View file

@ -197,6 +197,13 @@ void DiveListView::diveSelectionChanged(const QVector<QModelIndex> &indexes, boo
continue;
s->select(localIndex, flags);
// If an item of a not-yet expanded trip is selected, expand the trip.
if (select && localIndex.parent().isValid() && !isExpanded(localIndex.parent())) {
setAnimated(false);
expand(localIndex.parent());
setAnimated(true);
}
}
}