From b16be29595f09daa422c2c07075d3b8b60e7fad9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 13 Aug 2018 10:20:55 -0400 Subject: 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 --- desktop-widgets/divelistview.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'desktop-widgets') 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 &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); + } } } -- cgit v1.2.3-70-g09d2