profile: clean double calls on mobile version

Expanded #ifdef MOBILE with #else so that settings
are only called once.

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-06-08 11:24:50 +02:00 committed by Dirk Hohndel
parent 99eff8e247
commit cade4829a3

View file

@ -391,19 +391,21 @@ void ProfileWidget2::setupItemSizes()
itemPos.depth.pos.off.setX(-2); itemPos.depth.pos.off.setX(-2);
itemPos.depth.pos.off.setY(3); itemPos.depth.pos.off.setY(3);
itemPos.depth.expanded.setP1(QPointF(0, 0)); itemPos.depth.expanded.setP1(QPointF(0, 0));
#ifndef SUBSURFACE_MOBILE
itemPos.depth.expanded.setP2(QPointF(0, 85)); itemPos.depth.expanded.setP2(QPointF(0, 85));
#else
itemPos.depth.expanded.setP2(QPointF(0, 65));
#endif
itemPos.depth.shrinked.setP1(QPointF(0, 0)); itemPos.depth.shrinked.setP1(QPointF(0, 0));
itemPos.depth.shrinked.setP2(QPointF(0, 55)); itemPos.depth.shrinked.setP2(QPointF(0, 55));
itemPos.depth.intermediate.setP1(QPointF(0, 0)); itemPos.depth.intermediate.setP1(QPointF(0, 0));
itemPos.depth.intermediate.setP2(QPointF(0, 65)); itemPos.depth.intermediate.setP2(QPointF(0, 65));
#ifdef SUBSURFACE_MOBILE
itemPos.depth.expanded.setP2(QPointF(0, 65));
#endif
// Time Axis Config // Time Axis Config
itemPos.time.pos.on.setX(3); itemPos.time.pos.on.setX(3);
#ifndef SUBSURFACE_MOBILE
itemPos.time.pos.on.setY(95); itemPos.time.pos.on.setY(95);
#ifdef SUBSURFACE_MOBILE #else
itemPos.time.pos.on.setY(89.5); itemPos.time.pos.on.setY(89.5);
#endif #endif
itemPos.time.pos.off.setX(3); itemPos.time.pos.off.setX(3);
@ -413,15 +415,17 @@ void ProfileWidget2::setupItemSizes()
// Partial Gas Axis Config // Partial Gas Axis Config
itemPos.partialPressure.pos.on.setX(97); itemPos.partialPressure.pos.on.setX(97);
#ifndef SUBSURFACE_MOBILE
itemPos.partialPressure.pos.on.setY(75); itemPos.partialPressure.pos.on.setY(75);
#ifdef SUBSURFACE_MOBILE #else
itemPos.partialPressure.pos.on.setY(70); itemPos.partialPressure.pos.on.setY(70);
#endif #endif
itemPos.partialPressure.pos.off.setX(110); itemPos.partialPressure.pos.off.setX(110);
itemPos.partialPressure.pos.off.setY(63); itemPos.partialPressure.pos.off.setY(63);
itemPos.partialPressure.expanded.setP1(QPointF(0, 0)); itemPos.partialPressure.expanded.setP1(QPointF(0, 0));
#ifndef SUBSURFACE_MOBILE
itemPos.partialPressure.expanded.setP2(QPointF(0, 19)); itemPos.partialPressure.expanded.setP2(QPointF(0, 19));
#ifdef SUBSURFACE_MOBILE #else
itemPos.partialPressure.expanded.setP2(QPointF(0, 20)); itemPos.partialPressure.expanded.setP2(QPointF(0, 20));
#endif #endif
itemPos.partialPressureWithTankBar = itemPos.partialPressure; itemPos.partialPressureWithTankBar = itemPos.partialPressure;
@ -445,21 +449,20 @@ void ProfileWidget2::setupItemSizes()
// Temperature axis config // Temperature axis config
itemPos.temperature.pos.on.setX(3); itemPos.temperature.pos.on.setX(3);
itemPos.temperature.pos.on.setY(60);
itemPos.temperatureAll.pos.on.setY(51);
itemPos.temperature.pos.off.setX(-10); itemPos.temperature.pos.off.setX(-10);
itemPos.temperature.pos.off.setY(40); itemPos.temperature.pos.off.setY(40);
itemPos.temperature.expanded.setP1(QPointF(0, 20)); itemPos.temperature.expanded.setP1(QPointF(0, 20));
itemPos.temperature.expanded.setP2(QPointF(0, 33)); itemPos.temperature.expanded.setP2(QPointF(0, 33));
itemPos.temperature.shrinked.setP1(QPointF(0, 2)); itemPos.temperature.shrinked.setP1(QPointF(0, 2));
itemPos.temperature.shrinked.setP2(QPointF(0, 12)); itemPos.temperature.shrinked.setP2(QPointF(0, 12));
#ifndef SUBSURFACE_MOBILE
itemPos.temperature.pos.on.setY(60);
itemPos.temperatureAll.pos.on.setY(51);
itemPos.temperature.intermediate.setP1(QPointF(0, 2)); itemPos.temperature.intermediate.setP1(QPointF(0, 2));
itemPos.temperature.intermediate.setP2(QPointF(0, 12)); itemPos.temperature.intermediate.setP2(QPointF(0, 12));
#ifdef SUBSURFACE_MOBILE #else
itemPos.temperature.pos.on.setY(51); itemPos.temperature.pos.on.setY(51);
itemPos.temperatureAll.pos.on.setY(47); 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.setP1(QPointF(0, 2));
itemPos.temperature.intermediate.setP2(QPointF(0, 12)); itemPos.temperature.intermediate.setP2(QPointF(0, 12));
#endif #endif
@ -486,8 +489,9 @@ void ProfileWidget2::setupItemSizes()
itemPos.dcLabel.off.setY(100); itemPos.dcLabel.off.setY(100);
itemPos.tankBar.on.setX(0); itemPos.tankBar.on.setX(0);
#ifndef SUBSURFACE_MOBILE
itemPos.tankBar.on.setY(91.95); itemPos.tankBar.on.setY(91.95);
#ifdef SUBSURFACE_MOBILE #else
itemPos.tankBar.on.setY(86.4); itemPos.tankBar.on.setY(86.4);
#endif #endif
} }
@ -1107,11 +1111,9 @@ void ProfileWidget2::setEmptyState()
#ifndef SUBSURFACE_MOBILE #ifndef SUBSURFACE_MOBILE
hideAll(allTissues); hideAll(allTissues);
hideAll(allPercentages); hideAll(allPercentages);
#endif
hideAll(eventItems);
#ifndef SUBSURFACE_MOBILE
hideAll(handles); hideAll(handles);
#endif #endif
hideAll(eventItems);
hideAll(gases); hideAll(gases);
} }