diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-08-15 07:30:31 -0600 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-15 07:30:31 -0600 |
commit | e71119b40bac8d6dc33449e33329f235350b08f5 (patch) | |
tree | 318e48a393e4e14194c329f470e8b81b6c328ddb /qt-ui/profile/profilewidget2.cpp | |
parent | 5b14ed16accc39a1ed46f894404b10655576e386 (diff) | |
download | subsurface-e71119b40bac8d6dc33449e33329f235350b08f5.tar.gz |
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>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index a9c7a52e8..400bedde1 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -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); |