mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Expand the trip of the newly selected dive.
I hit this bug on deleting dives and the newly selected one got inside a trip, that wasn't expanded. anyway, easy one. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8476ea5ea8
commit
4f1cae7a2f
1 changed files with 5 additions and 0 deletions
|
@ -159,6 +159,11 @@ void DiveListView::selectDive(int i, bool scrollto, bool toggle)
|
||||||
flags = toggle ? QItemSelectionModel::Toggle : QItemSelectionModel::Select;
|
flags = toggle ? QItemSelectionModel::Toggle : QItemSelectionModel::Select;
|
||||||
flags |= QItemSelectionModel::Rows;
|
flags |= QItemSelectionModel::Rows;
|
||||||
selectionModel()->select(idx, flags);
|
selectionModel()->select(idx, flags);
|
||||||
|
if(idx.parent().isValid()){
|
||||||
|
setAnimated(false);
|
||||||
|
expand(idx.parent());
|
||||||
|
setAnimated(true);
|
||||||
|
}
|
||||||
if (scrollto)
|
if (scrollto)
|
||||||
scrollTo(idx, PositionAtCenter);
|
scrollTo(idx, PositionAtCenter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue