diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-05-07 23:40:34 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-08 10:04:22 -0700 |
commit | 70c64eaa66f404d43ef5553c7cadc4eb887b79b4 (patch) | |
tree | 16a335db9047cc9aa7508b6c88d3aca7e162ce90 /qt-ui/profile | |
parent | 9d8eb1042125e4e33b593f37aec2d5bab13f1ac6 (diff) | |
download | subsurface-70c64eaa66f404d43ef5553c7cadc4eb887b79b4.tar.gz |
Only print gasname for a segment in planner if it differs from the previous one
This is to avoid visual clutter when replanning logged dives.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 2d1b7276f..a426ceef2 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1537,6 +1537,7 @@ void ProfileWidget2::repositionDiveHandlers() { DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance(); // Re-position the user generated dive handlers + struct gasmix mix, lastmix; for (int i = 0; i < plannerModel->rowCount(); i++) { struct divedatapoint datapoint = plannerModel->at(i); if (datapoint.time == 0) // those are the magic entries for tanks @@ -1561,8 +1562,9 @@ void ProfileWidget2::repositionDiveHandlers() QLineF line(p1, p2); QPointF pos = line.pointAt(0.5); gases[i]->setPos(pos); - gases[i]->setVisible(datapoint.entered); - gases[i]->setText(dpGasToStr(plannerModel->at(i))); + gases[i]->setText(dpGasToStr(datapoint)); + gases[i]->setVisible(datapoint.entered && + (i == 0 || gases[i]->text() != gases[i-1]->text())); } } |