mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
TankBar: use the itemPos as intended
Which actually makes the code much clearer as now the object is at the correct spot on the canvas and the positions inside are relative to that. No more magic gradiants starting at "92" Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5b14ed16ac
commit
e71119b40b
2 changed files with 10 additions and 5 deletions
|
@ -53,6 +53,7 @@ static struct _ItemPos {
|
|||
};
|
||||
_Pos background;
|
||||
_Pos dcLabel;
|
||||
_Pos tankBar;
|
||||
_Axis depth;
|
||||
_Axis partialPressure;
|
||||
_Axis time;
|
||||
|
@ -336,6 +337,9 @@ void ProfileWidget2::setupItemSizes()
|
|||
itemPos.dcLabel.on.setY(100);
|
||||
itemPos.dcLabel.off.setX(-10);
|
||||
itemPos.dcLabel.off.setY(100);
|
||||
|
||||
itemPos.tankBar.on.setX(0);
|
||||
itemPos.tankBar.on.setY(92);
|
||||
}
|
||||
|
||||
void ProfileWidget2::setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *hAxis,
|
||||
|
@ -818,6 +822,8 @@ void ProfileWidget2::setProfileState()
|
|||
}
|
||||
rulerItem->setVisible(prefs.rulergraph);
|
||||
tankItem->setVisible(true);
|
||||
tankItem->setPos(itemPos.tankBar.on);
|
||||
|
||||
#define HIDE_ALL(TYPE, CONTAINER) \
|
||||
Q_FOREACH (TYPE *item, CONTAINER) item->setVisible(false);
|
||||
HIDE_ALL(DiveHandler, handles);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue