mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
9d8eb10421
commit
70c64eaa66
1 changed files with 4 additions and 2 deletions
|
@ -1537,6 +1537,7 @@ void ProfileWidget2::repositionDiveHandlers()
|
||||||
{
|
{
|
||||||
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
||||||
// Re-position the user generated dive handlers
|
// Re-position the user generated dive handlers
|
||||||
|
struct gasmix mix, lastmix;
|
||||||
for (int i = 0; i < plannerModel->rowCount(); i++) {
|
for (int i = 0; i < plannerModel->rowCount(); i++) {
|
||||||
struct divedatapoint datapoint = plannerModel->at(i);
|
struct divedatapoint datapoint = plannerModel->at(i);
|
||||||
if (datapoint.time == 0) // those are the magic entries for tanks
|
if (datapoint.time == 0) // those are the magic entries for tanks
|
||||||
|
@ -1561,8 +1562,9 @@ void ProfileWidget2::repositionDiveHandlers()
|
||||||
QLineF line(p1, p2);
|
QLineF line(p1, p2);
|
||||||
QPointF pos = line.pointAt(0.5);
|
QPointF pos = line.pointAt(0.5);
|
||||||
gases[i]->setPos(pos);
|
gases[i]->setPos(pos);
|
||||||
gases[i]->setVisible(datapoint.entered);
|
gases[i]->setText(dpGasToStr(datapoint));
|
||||||
gases[i]->setText(dpGasToStr(plannerModel->at(i)));
|
gases[i]->setVisible(datapoint.entered &&
|
||||||
|
(i == 0 || gases[i]->text() != gases[i-1]->text()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue