Skip to content

Commit

Permalink
profile: show closed-hand cursor while panning
Browse files Browse the repository at this point in the history
To give visual feedback.

Signed-off-by: Berthold Stoeger <[email protected]>
  • Loading branch information
bstoeger authored and dirkhh committed Sep 3, 2022
1 parent edf2a2f commit 50d83ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion profile-widget/profilewidget2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ void ProfileWidget2::mousePressEvent(QMouseEvent *event)
panning = true;
panningOriginalMousePosition = mapToScene(event->pos()).x();
panningOriginalProfilePosition = zoomedPosition;
viewport()->setCursor(Qt::ClosedHandCursor);
}
}

Expand All @@ -297,7 +298,10 @@ void ProfileWidget2::divePlannerHandlerReleased()
void ProfileWidget2::mouseReleaseEvent(QMouseEvent *event)
{
QGraphicsView::mouseReleaseEvent(event);
panning = false;
if (panning) {
panning = false;
viewport()->setCursor(Qt::ArrowCursor);
}
if (currentState == PLAN || currentState == EDIT) {
shouldCalculateMax = true;
replot();
Expand Down

0 comments on commit 50d83ab

Please sign in to comment.