summaryrefslogtreecommitdiffstats
path: root/profile-widget/divetooltipitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget/divetooltipitem.cpp')
-rw-r--r--profile-widget/divetooltipitem.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp
index 49e9bdca7..fb7511e69 100644
--- a/profile-widget/divetooltipitem.cpp
+++ b/profile-widget/divetooltipitem.cpp
@@ -253,15 +253,16 @@ void ToolTipItem::refresh(const QPointF &pos)
mb.len = 0;
entry = get_plot_details_new(&pInfo, time, &mb);
+
+ tissues.fill();
+ painter.setPen(QColor(0, 0, 0, 0));
+ painter.setBrush(QColor(LIMENADE1));
+ painter.drawRect(0, 10 + (100 - AMB_PERCENTAGE) / 2, 16, AMB_PERCENTAGE / 2);
+ painter.setBrush(QColor(SPRINGWOOD1));
+ painter.drawRect(0, 10, 16, (100 - AMB_PERCENTAGE) / 2);
+ painter.setBrush(QColor(Qt::red));
+ painter.drawRect(0,0,16,10);
if (entry) {
- tissues.fill();
- painter.setPen(QColor(0, 0, 0, 0));
- painter.setBrush(QColor(LIMENADE1));
- painter.drawRect(0, 10 + (100 - AMB_PERCENTAGE) / 2, 16, AMB_PERCENTAGE / 2);
- painter.setBrush(QColor(SPRINGWOOD1));
- painter.drawRect(0, 10, 16, (100 - AMB_PERCENTAGE) / 2);
- painter.setBrush(QColor(Qt::red));
- painter.drawRect(0,0,16,10);
painter.setPen(QColor(0, 0, 0, 255));
painter.drawLine(0, 60 - entry->gfline / 2, 16, 60 - entry->gfline / 2);
painter.drawLine(0, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure / 2,
@@ -270,9 +271,9 @@ void ToolTipItem::refresh(const QPointF &pos)
for (int i=0; i<16; i++) {
painter.drawLine(i, 60, i, 60 - entry->percentages[i] / 2);
}
- entryToolTip.first->setPixmap(tissues);
entryToolTip.second->setText(QString::fromUtf8(mb.buffer, mb.len));
}
+ entryToolTip.first->setPixmap(tissues);
Q_FOREACH (QGraphicsItem *item, scene()->items(pos, Qt::IntersectsItemBoundingRect
,Qt::DescendingOrder, scene()->views().first()->transform())) {