the 676 it's harder than I think to fix, but it's user error so nothing very urgent.
From e962983873666e996c4c425c712a70d80eb1782e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <[email protected]> Date: Tue, 5 Aug 2014 17:40:50 -0300 Subject: [PATCH 1/2] Hide Depth Column
we were showing everything, always. fixes #639 Signed-off-by: Tomaz Canabrava <[email protected]> --- qt-ui/maintab.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index c704f55..5a37c16 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -582,6 +582,7 @@ void MainTab::updateDiveInfo(bool clear) ui.visibility->setCurrentStars(0); } editMode = NONE; + ui.cylinders->view()->hideColumn(CylindersModel::DEPTH); } void MainTab::addCylinder_clicked() -- 2.0.4
From b09ceb9ef237977bb2fcf49bba0053d0a4b2bf42 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <[email protected]> Date: Tue, 5 Aug 2014 18:27:00 -0300 Subject: [PATCH 2/2] Add lines that follows the mouse helping see time and depth. This was missing from the conversion from the oldPlanner to the new one, and it also works ok on the profile. One thing is missing is the Labels on the bottom / left saying which position it is, but it's already userful. fixes #674 Signed-off-by: Tomaz Canabrava <[email protected]> --- qt-ui/profile/profilewidget2.cpp | 28 ++++++++++++++++++++++++++++ qt-ui/profile/profilewidget2.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index c3a289d..b19ca81 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -86,6 +86,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), po2GasItem(new PartialPressureGasItem()), heartBeatAxis(new DiveCartesianAxis()), heartBeatItem(new DiveHeartrateItem()), + mouseFollowerHorizontal(new DiveLineItem()), + mouseFollowerVertical(new DiveLineItem()), rulerItem(new RulerItem2()), isGrayscale(false), printMode(false), @@ -158,6 +160,10 @@ void ProfileWidget2::addItemsToScene() scene()->addItem(rulerItem); scene()->addItem(rulerItem->sourceNode()); scene()->addItem(rulerItem->destNode()); + scene()->addItem(mouseFollowerHorizontal); + scene()->addItem(mouseFollowerVertical); + mouseFollowerHorizontal->setPen(QPen(QColor(Qt::red).lighter())); + mouseFollowerVertical->setPen(QPen(QColor(Qt::red).lighter())); Q_FOREACH (DiveCalculatedTissue *tissue, allTissues) { scene()->addItem(tissue); } @@ -665,6 +671,20 @@ void ProfileWidget2::mouseMoveEvent(QMouseEvent *event) scrollViewTo(event->pos()); toolTipItem->setPos(mapToScene(toolTipPos)); } + + QPointF pos = mapToScene(event->pos()); + qreal vValue = profileYAxis->valueAt(pos); + qreal hValue = timeAxis->valueAt(pos); + if ( profileYAxis->maximum() >= vValue + && profileYAxis->minimum() <= vValue){ + mouseFollowerHorizontal->setPos(timeAxis->pos().x(), pos.y()); + } + if ( timeAxis->maximum() >= hValue + && timeAxis->minimum() <= hValue){ + mouseFollowerVertical->setPos(pos.x(), profileYAxis->line().y1()); + } + + } bool ProfileWidget2::eventFilter(QObject *object, QEvent *event) @@ -706,6 +726,8 @@ void ProfileWidget2::setEmptyState() pn2GasItem->setVisible(false); po2GasItem->setVisible(false); pheGasItem->setVisible(false); + mouseFollowerHorizontal->setVisible(false); + mouseFollowerVertical->setVisible(false); #define HIDE_ALL(TYPE, CONTAINER) \ Q_FOREACH (TYPE *item, CONTAINER) item->setVisible(false); @@ -788,6 +810,10 @@ void ProfileWidget2::setProfileState() HIDE_ALL(DiveHandler, handles); HIDE_ALL(QGraphicsSimpleTextItem, gases); #undef HIDE_ALL + mouseFollowerHorizontal->setVisible(true); + mouseFollowerVertical->setVisible(true); + mouseFollowerHorizontal->setLine(timeAxis->line()); + mouseFollowerVertical->setLine(QLineF(0, profileYAxis->pos().y(), 0, timeAxis->pos().y())); } void ProfileWidget2::setAddState() @@ -1055,6 +1081,8 @@ void ProfileWidget2::setPrintMode(bool mode, bool grayscale) { printMode = mode; isGrayscale = mode ? grayscale : false; + mouseFollowerHorizontal->setVisible( !mode ); + mouseFollowerVertical->setVisible( !mode ); } void ProfileWidget2::setFontPrintScale(double scale) diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index bcde4a2..c3db984 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -161,6 +161,8 @@ private: PartialPressureGasItem *po2GasItem; DiveCartesianAxis *heartBeatAxis; DiveHeartrateItem *heartBeatItem; + DiveLineItem *mouseFollowerVertical; + DiveLineItem *mouseFollowerHorizontal; RulerItem2 *rulerItem; bool isGrayscale; bool printMode; -- 2.0.4
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
