From 11ccadbab5a8da5a43410b23ffb7b96f5c850051 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Sat, 4 Feb 2017 10:46:02 +0100 Subject: MOBILE: Reposition objects in the profile Add the tankbar to the profile and change the relative positions of the depth and temperature curves to minimize overlap. Signed-off-by: Joakim Bygdell --- profile-widget/profilewidget2.cpp | 21 ++++++++++++++++----- profile-widget/tankitem.cpp | 3 +++ 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'profile-widget') diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 38aa9d64f..df879fbb8 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -224,6 +224,7 @@ void ProfileWidget2::addItemsToScene() diveComputerText->setData(SUBSURFACE_OBJ_DATA, SUBSURFACE_OBJ_DC_TEXT); scene()->addItem(diveComputerText); scene()->addItem(reportedCeiling); + scene()->addItem(tankItem); #ifndef SUBSURFACE_MOBILE scene()->addItem(toolTipItem); scene()->addItem(diveCeiling); @@ -241,7 +242,6 @@ void ProfileWidget2::addItemsToScene() scene()->addItem(rulerItem); scene()->addItem(rulerItem->sourceNode()); scene()->addItem(rulerItem->destNode()); - scene()->addItem(tankItem); scene()->addItem(mouseFollowerHorizontal); scene()->addItem(mouseFollowerVertical); QPen pen(QColor(Qt::red).lighter()); @@ -420,12 +420,15 @@ void ProfileWidget2::setupItemSizes() itemPos.depth.shrinked.setP2(QPointF(0, 55)); itemPos.depth.intermediate.setP1(QPointF(0, 0)); itemPos.depth.intermediate.setP2(QPointF(0, 65)); +#ifdef SUBSURFACE_MOBILE + itemPos.depth.expanded.setP2(QPointF(0, 65)); +#endif // Time Axis Config itemPos.time.pos.on.setX(3); itemPos.time.pos.on.setY(95); #ifdef SUBSURFACE_MOBILE - itemPos.time.pos.on.setY(89); + itemPos.time.pos.on.setY(89.5); #endif itemPos.time.pos.off.setX(3); itemPos.time.pos.off.setY(110); @@ -461,9 +464,6 @@ void ProfileWidget2::setupItemSizes() // Temperature axis config itemPos.temperature.pos.on.setX(3); itemPos.temperature.pos.on.setY(60); -#ifdef SUBSURFACE_MOBILE - itemPos.temperature.pos.on.setY(50); -#endif itemPos.temperatureAll.pos.on.setY(51); itemPos.temperature.pos.off.setX(-10); itemPos.temperature.pos.off.setY(40); @@ -473,6 +473,14 @@ void ProfileWidget2::setupItemSizes() itemPos.temperature.shrinked.setP2(QPointF(0, 12)); itemPos.temperature.intermediate.setP1(QPointF(0, 2)); itemPos.temperature.intermediate.setP2(QPointF(0, 12)); +#ifdef SUBSURFACE_MOBILE + itemPos.temperature.pos.on.setY(51); + itemPos.temperatureAll.pos.on.setY(47); + itemPos.temperature.expanded.setP1(QPointF(0, 20)); + itemPos.temperature.expanded.setP2(QPointF(0, 33)); + itemPos.temperature.intermediate.setP1(QPointF(0, 2)); + itemPos.temperature.intermediate.setP2(QPointF(0, 12)); +#endif // Heartbeat axis config itemPos.heartBeat.pos.on.setX(3); @@ -497,6 +505,9 @@ void ProfileWidget2::setupItemSizes() itemPos.tankBar.on.setX(0); itemPos.tankBar.on.setY(91.95); +#ifdef SUBSURFACE_MOBILE + itemPos.tankBar.on.setY(86.4); +#endif } void ProfileWidget2::setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *hAxis, diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp index 98655c4fa..1d1caad50 100644 --- a/profile-widget/tankitem.cpp +++ b/profile-widget/tankitem.cpp @@ -74,6 +74,9 @@ void TankItem::createBar(qreal x, qreal w, struct gasmix *gas) label->setBrush(Qt::black); label->setPos(x + 1, 0); label->setAlignment(Qt::AlignBottom | Qt::AlignRight); +#ifdef SUBSURFACE_MOBILE + label->setPos(x + 1, -2.5); +#endif label->setZValue(101); } -- cgit v1.2.3-70-g09d2