diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-11-27 21:24:48 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-28 15:27:18 -0800 |
commit | c1102a38f359b9c155183a39fb059870d63e1d6d (patch) | |
tree | f4eb5af651e96aab80c1c0740db423a3eff6a978 /qt-ui | |
parent | 4d0d5f8c07d045918d6215277773b9755dc681b6 (diff) | |
download | subsurface-c1102a38f359b9c155183a39fb059870d63e1d6d.tar.gz |
More gradient on the partial pressure graph.
This patch adds a bit more of gradient on the lines for the partal
pressure graph grid, it also moves a tiny bit to the side the
even numbers so it's easyer to read when they are too near each other.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 766f7cd5e..de3e9cd59 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -545,17 +545,26 @@ void ProfileGraphicsView::plot_pp_text() setup_pp_limits(&gc); pp = floor(gc.pi.maxpp * 10.0) / 10.0 + 0.2; - dpp = pp > 4 ? 1.0 : 0.5; + dpp = pp > 4 ? 0.5 : 0.2; hpos = gc.pi.entry[gc.pi.nr - 1].sec; QColor c = getColor(PP_LINES); + bool alt = false; for (m = 0.0; m <= pp; m += dpp) { QGraphicsLineItem *item = new QGraphicsLineItem(SCALEGC(0, m), SCALEGC(hpos, m)); QPen pen(defaultPen); pen.setColor(c); + if ( QString::number(m).toDouble() != QString::number(m).toInt()){ + pen.setStyle(Qt::DashLine); + pen.setWidthF(1.2); + } item->setPen(pen); scene()->addItem(item); - plot_text(&tro, QPointF(hpos, m), QString::number(m), pressureMarkers); + qreal textPos = hpos; + if (alt) + textPos += 30; + alt = !alt; + plot_text(&tro, QPointF(textPos, m), QString::number(m), pressureMarkers); } scene()->addItem(pressureMarkers); pressureMarkers->setPos(pressureMarkers->pos().x() + 10, 0); |