Skip to content

Commit

Permalink
Use closed hand cursor when dragging canvas with middle mouse button
Browse files Browse the repository at this point in the history
(cherry-picked from 2dcd405)
  • Loading branch information
nyalldawson committed Jul 26, 2016
1 parent 532f9d5 commit 65311fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1405,6 +1405,7 @@ void QgsMapCanvas::mousePressEvent( QMouseEvent* e )
//use middle mouse button for panning, map tools won't receive any events in that case //use middle mouse button for panning, map tools won't receive any events in that case
if ( e->button() == Qt::MidButton ) if ( e->button() == Qt::MidButton )
{ {
QApplication::setOverrideCursor( Qt::ClosedHandCursor );
mCanvasProperties->panSelectorDown = true; mCanvasProperties->panSelectorDown = true;
mCanvasProperties->rubberStartPoint = mCanvasProperties->mouseLastXY; mCanvasProperties->rubberStartPoint = mCanvasProperties->mouseLastXY;
} }
Expand Down Expand Up @@ -1443,6 +1444,7 @@ void QgsMapCanvas::mouseReleaseEvent( QMouseEvent* e )
//use middle mouse button for panning, map tools won't receive any events in that case //use middle mouse button for panning, map tools won't receive any events in that case
if ( e->button() == Qt::MidButton ) if ( e->button() == Qt::MidButton )
{ {
QApplication::restoreOverrideCursor();
mCanvasProperties->panSelectorDown = false; mCanvasProperties->panSelectorDown = false;
panActionEnd( mCanvasProperties->mouseLastXY ); panActionEnd( mCanvasProperties->mouseLastXY );
} }
Expand Down

0 comments on commit 65311fc

Please sign in to comment.