diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-20 17:54:36 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-20 17:54:36 -0300 |
commit | cbdd78c0fca06645248dafe3999bbabd91c48449 (patch) | |
tree | 8894d8b704909095b88aad322b9b8bbdffbb81a2 | |
parent | 2d683b66a8a7d514c8cd766303832876ccbab9bb (diff) | |
download | subsurface-cbdd78c0fca06645248dafe3999bbabd91c48449.tar.gz |
Added text to the rules so the user knows what's happening at that point.
Added text to the rules, so the user knows what's happening at that point
The text will move left / right ( for time ) and up / down ( for depth )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r-- | qt-ui/diveplanner.cpp | 15 | ||||
-rw-r--r-- | qt-ui/diveplanner.h | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index fa7be75b3..33a759f1d 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -39,6 +39,16 @@ DivePlanner::DivePlanner(QWidget* parent): QGraphicsView(parent), activeDraggedH depthLine->setOrientation(Qt::Vertical); depthLine->updateTicks(); scene()->addItem(depthLine); + + timeString = new QGraphicsSimpleTextItem(); + timeString->setFlag(QGraphicsItem::ItemIgnoresTransformations); + scene()->addItem(timeString); + + depthString = new QGraphicsSimpleTextItem(); + depthString->setFlag(QGraphicsItem::ItemIgnoresTransformations); + scene()->addItem(depthString); + + } void DivePlanner::mouseDoubleClickEvent(QMouseEvent* event) @@ -127,10 +137,13 @@ void DivePlanner::mouseMoveEvent(QMouseEvent* event) verticalLine->setLine(mappedPos.x(), 0, mappedPos.x(), 100); horizontalLine->setLine(0, mappedPos.y(), 100, mappedPos.y()); + depthString->setText(QString::number(depthLine->valueAt(mappedPos))); + depthString->setPos(0, mappedPos.y()); + timeString->setText(QString::number( (int) timeLine->valueAt(mappedPos)) + "min"); + timeString->setPos(mappedPos.x()+1, 90); if(activeDraggedHandler) moveActiveHandler(mappedPos); - if (!handles.count()) return; diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index f7af25113..0e7f6f4b2 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -63,7 +63,10 @@ private: DiveHandler *activeDraggedHandler; Ruler *timeLine; + QGraphicsSimpleTextItem *timeString; + Ruler *depthLine; + QGraphicsSimpleTextItem *depthString; }; #endif |