mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Create the grids.
Create the grids, and the way that they move is fabulous <3 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
38e25458ee
commit
883b25cea3
2 changed files with 31 additions and 1 deletions
|
@ -65,7 +65,7 @@ DiveCartesianAxis::DiveCartesianAxis() : QObject(),
|
||||||
labelScale(1.0),
|
labelScale(1.0),
|
||||||
tick_size(0),
|
tick_size(0),
|
||||||
textVisibility(true),
|
textVisibility(true),
|
||||||
line_size(-1)
|
line_size(1)
|
||||||
{
|
{
|
||||||
setPen(gridPen());
|
setPen(gridPen());
|
||||||
}
|
}
|
||||||
|
@ -195,6 +195,32 @@ void DiveCartesianAxis::updateTicks()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add's the rest of the needed Ticks / Text.
|
||||||
|
for (int i = lines.size(); i < steps; i++, currValueText += interval) {
|
||||||
|
qreal childPos;
|
||||||
|
if (orientation == TopToBottom || orientation == LeftToRight) {
|
||||||
|
childPos = begin + i * stepSize;
|
||||||
|
} else {
|
||||||
|
childPos = begin - i * stepSize;
|
||||||
|
}
|
||||||
|
DiveLineItem *line = new DiveLineItem(this);
|
||||||
|
QPen pen;
|
||||||
|
pen.setBrush(getColor(TIME_GRID));
|
||||||
|
pen.setCosmetic(true);
|
||||||
|
pen.setWidthF(2);
|
||||||
|
line->setPen(pen);
|
||||||
|
lines.push_back(line);
|
||||||
|
if (orientation == RightToLeft || orientation == LeftToRight) {
|
||||||
|
line->setLine(0,-line_size,0, 0);
|
||||||
|
line->animateMoveTo(childPos, m.y1());
|
||||||
|
} else {
|
||||||
|
QPointF p1 = mapFromScene(3, 0);
|
||||||
|
QPointF p2 = mapFromScene(line_size, 0);
|
||||||
|
line->setLine(p1.x(), 0, p2.x(), 0);
|
||||||
|
line->animateMoveTo(m.x1(), childPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Q_FOREACH(DiveTextItem *item, labels){
|
Q_FOREACH(DiveTextItem *item, labels){
|
||||||
item->setVisible(textVisibility);
|
item->setVisible(textVisibility);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,9 @@ void ProfileWidget2::setupItemOnScene()
|
||||||
profileYAxis->setMinimum(0);
|
profileYAxis->setMinimum(0);
|
||||||
profileYAxis->setTickInterval(M_OR_FT(10,30));
|
profileYAxis->setTickInterval(M_OR_FT(10,30));
|
||||||
profileYAxis->setTickSize(1);
|
profileYAxis->setTickSize(1);
|
||||||
|
profileYAxis->setLineSize(96);
|
||||||
|
|
||||||
|
timeAxis->setLineSize(96);
|
||||||
|
|
||||||
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
||||||
gasYAxis->setTickInterval(1);
|
gasYAxis->setTickInterval(1);
|
||||||
|
@ -131,6 +134,7 @@ void ProfileWidget2::setupItemOnScene()
|
||||||
gasYAxis->setMinimum(0);
|
gasYAxis->setMinimum(0);
|
||||||
gasYAxis->setModel(dataModel);
|
gasYAxis->setModel(dataModel);
|
||||||
gasYAxis->setFontLabelScale(0.7);
|
gasYAxis->setFontLabelScale(0.7);
|
||||||
|
gasYAxis->setLineSize(96);
|
||||||
|
|
||||||
temperatureAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
temperatureAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
||||||
temperatureAxis->setTickSize(2);
|
temperatureAxis->setTickSize(2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue