mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
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>
This commit is contained in:
parent
cc225a44f2
commit
c986940630
2 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue