aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-02-15 22:43:27 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-15 17:30:25 -0800
commit883b25cea30727aac641f2809a14da38e2eb3e96 (patch)
tree551aa240286989dd28d6b180b4ca692b505da62a
parent38e25458ee9b92ecf170a458ec442d3e362ee5dc (diff)
downloadsubsurface-883b25cea30727aac641f2809a14da38e2eb3e96.tar.gz
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>
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp28
-rw-r--r--qt-ui/profile/profilewidget2.cpp4
2 files changed, 31 insertions, 1 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index c47ff4a28..e176d4f73 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -65,7 +65,7 @@ DiveCartesianAxis::DiveCartesianAxis() : QObject(),
labelScale(1.0),
tick_size(0),
textVisibility(true),
- line_size(-1)
+ line_size(1)
{
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){
item->setVisible(textVisibility);
}
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 088cfba1f..e68b543fb 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -124,6 +124,9 @@ void ProfileWidget2::setupItemOnScene()
profileYAxis->setMinimum(0);
profileYAxis->setTickInterval(M_OR_FT(10,30));
profileYAxis->setTickSize(1);
+ profileYAxis->setLineSize(96);
+
+ timeAxis->setLineSize(96);
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
gasYAxis->setTickInterval(1);
@@ -131,6 +134,7 @@ void ProfileWidget2::setupItemOnScene()
gasYAxis->setMinimum(0);
gasYAxis->setModel(dataModel);
gasYAxis->setFontLabelScale(0.7);
+ gasYAxis->setLineSize(96);
temperatureAxis->setOrientation(DiveCartesianAxis::BottomToTop);
temperatureAxis->setTickSize(2);