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>
This commit is contained in:
Tomaz Canabrava 2013-11-27 21:24:48 -02:00 committed by Dirk Hohndel
parent 4d0d5f8c07
commit c1102a38f3

View file

@ -545,17 +545,26 @@ void ProfileGraphicsView::plot_pp_text()
setup_pp_limits(&gc); setup_pp_limits(&gc);
pp = floor(gc.pi.maxpp * 10.0) / 10.0 + 0.2; 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; hpos = gc.pi.entry[gc.pi.nr - 1].sec;
QColor c = getColor(PP_LINES); QColor c = getColor(PP_LINES);
bool alt = false;
for (m = 0.0; m <= pp; m += dpp) { for (m = 0.0; m <= pp; m += dpp) {
QGraphicsLineItem *item = new QGraphicsLineItem(SCALEGC(0, m), SCALEGC(hpos, m)); QGraphicsLineItem *item = new QGraphicsLineItem(SCALEGC(0, m), SCALEGC(hpos, m));
QPen pen(defaultPen); QPen pen(defaultPen);
pen.setColor(c); pen.setColor(c);
if ( QString::number(m).toDouble() != QString::number(m).toInt()){
pen.setStyle(Qt::DashLine);
pen.setWidthF(1.2);
}
item->setPen(pen); item->setPen(pen);
scene()->addItem(item); 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); scene()->addItem(pressureMarkers);
pressureMarkers->setPos(pressureMarkers->pos().x() + 10, 0); pressureMarkers->setPos(pressureMarkers->pos().x() + 10, 0);