summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-13 10:20:55 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-11 16:22:27 -0700
commitb16be29595f09daa422c2c07075d3b8b60e7fad9 (patch)
tree83de35831774e8a2f9492320a8e38ef64854c92f
parent2a61664ceb865f6569b916f2c3f1487af8c5d37f (diff)
downloadsubsurface-b16be29595f09daa422c2c07075d3b8b60e7fad9.tar.gz
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>
-rw-r--r--desktop-widgets/divelistview.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index 8ed07b4db..4bfc6ea60 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -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);
+ }
}
}