aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-29 10:31:34 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-29 10:31:34 -0700
commitccaff3a06da9c638cd1088329e10944320e1f66e (patch)
tree99b2be63f037add694d95b2a8e0bda16996e9ac2 /qt-ui/profile/diveprofileitem.cpp
parenta4608f7c91138401e9987ff0478bbe42408a37a7 (diff)
downloadsubsurface-ccaff3a06da9c638cd1088329e10944320e1f66e.tar.gz
Make gradient factor text an independent item on the profile
Having it as part of the DiveCalculatedCeiling class caused us to manage this text 17 times (and plotting it 17 times) which is rather silly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 5ae46003c..986a0eac0 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -788,11 +788,8 @@ void DiveGasPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
painter->restore();
}
-DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false), gradientFactor(new DiveTextItem(this))
+DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false)
{
- gradientFactor->setY(0);
- gradientFactor->setBrush(getColor(PRESSURE_TEXT));
- gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
settingsChanged();
}
@@ -821,15 +818,6 @@ void DiveCalculatedCeiling::modelDataChanged(const QModelIndex &topLeft, const Q
pat.setColorAt(1, getColor(CALC_CEILING_DEEP));
setPen(QPen(QBrush(Qt::NoBrush), 0));
setBrush(pat);
-
- gradientFactor->setX(poly.boundingRect().width() / 2 + poly.boundingRect().x());
- DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
- if (plannerModel->isPlanner()) {
- struct diveplan &diveplan = plannerModel->getDiveplan();
- gradientFactor->setText(QString("GF %1/%2").arg(diveplan.gflow).arg(diveplan.gfhigh));
- } else {
- gradientFactor->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh));
- }
}
void DiveCalculatedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)