summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-10-17 11:28:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-20 06:50:52 -0400
commitc9869406301ff72f76b399097f0845fc1102ced1 (patch)
treeab48606d6802671fae8bd246e15bbc5975cc47c6
parentcc225a44f2342d343e97a58b38b2f510ba1d173c (diff)
downloadsubsurface-c9869406301ff72f76b399097f0845fc1102ced1.tar.gz
Profile: show correct info box for multiple DCs
Update the dive info box when toggling the chosen DC using the keyboard. The keyboard toggle does not generate a mouse move event, so this data was not repainted. For this, a sub-optimization of not repainting when not moving the mouse had to be removed. This does not impact ant performance as 99.9999% of the calls of the repaint are caused by mouse movement anyway. Fixes: #1802 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
-rw-r--r--profile-widget/divetooltipitem.cpp2
-rw-r--r--profile-widget/profilewidget2.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp
index d1bda0a01..0d3e6728c 100644
--- a/profile-widget/divetooltipitem.cpp
+++ b/profile-widget/divetooltipitem.cpp
@@ -240,8 +240,6 @@ void ToolTipItem::refresh(const QPointF &pos)
refreshTime.start();
int time = lrint(timeAxis->valueAt(pos));
- if (time == lastTime)
- return;
lastTime = time;
clear();
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 3b932144b..846465672 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -828,6 +828,8 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures)
clearPictures();
else
plotPictures();
+
+ toolTipItem->refresh(mapToScene(mapFromGlobal(QCursor::pos())));
#endif
// OK, how long did this take us? Anything above the second is way too long,
@@ -1066,7 +1068,8 @@ void ProfileWidget2::scrollViewTo(const QPoint &pos)
void ProfileWidget2::mouseMoveEvent(QMouseEvent *event)
{
QPointF pos = mapToScene(event->pos());
- toolTipItem->refresh(pos);
+ toolTipItem->refresh(mapToScene(mapFromGlobal(QCursor::pos())));
+
if (zoomLevel == 0) {
QGraphicsView::mouseMoveEvent(event);
} else {