Skip to content
Permalink
Browse files
[needs-docs] Use alt modifier to reverse zoom behaviour
Previously shift-modifier was used to change zoom in to out, and
zoom out to in. This commit changes it to the more common alt
modifier.
  • Loading branch information
nyalldawson committed Jan 23, 2017
1 parent 7a0fa23 commit ea2ff06c79786b380275b99a1c52f3bc73d97c1c
Showing with 9 additions and 9 deletions.
  1. +8 −8 src/gui/qgscomposerview.cpp
  2. +1 −1 src/gui/qgsmaptoolzoom.cpp
@@ -290,7 +290,7 @@ void QgsComposerView::mousePressEvent( QMouseEvent* e )

case Zoom:
{
if ( !( e->modifiers() & Qt::ShiftModifier ) )
if ( !( e->modifiers() & Qt::AltModifier ) )
{
//zoom in action
startMarqueeZoom( scenePoint );
@@ -1706,7 +1706,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
{
//both control and space pressed
//set cursor to zoom in/out depending on shift key status
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
viewport()->setCursor( zoomCursor );
}
@@ -1740,8 +1740,8 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
mTemporaryZoomStatus = QgsComposerView::Active;
mPreviousTool = mCurrentTool;
setCurrentTool( Zoom );
//set cursor to zoom in/out depending on shift key status
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
//set cursor to zoom in/out depending on alt key status
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
viewport()->setCursor( zoomCursor );
return;
@@ -1750,10 +1750,10 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )

if ( mCurrentTool == QgsComposerView::Zoom )
{
//using the zoom tool, respond to changes in shift key status and update mouse cursor accordingly
//using the zoom tool, respond to changes in alt key status and update mouse cursor accordingly
if ( ! e->isAutoRepeat() )
{
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
viewport()->setCursor( zoomCursor );
}
@@ -1939,10 +1939,10 @@ void QgsComposerView::keyReleaseEvent( QKeyEvent * e )
}
else if ( mCurrentTool == QgsComposerView::Zoom )
{
//if zoom tool is active, respond to changes in the shift key status and update cursor accordingly
//if zoom tool is active, respond to changes in the alt key status and update cursor accordingly
if ( ! e->isAutoRepeat() )
{
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
viewport()->setCursor( zoomCursor );
}
@@ -84,7 +84,7 @@ void QgsMapToolZoom::canvasReleaseEvent( QgsMapMouseEvent* e )
return;

bool zoomOut = mZoomOut;
if ( e->modifiers() & Qt::ShiftModifier )
if ( e->modifiers() & Qt::AltModifier )
zoomOut = !zoomOut;

// We are not really dragging in this case. This is sometimes caused by

0 comments on commit ea2ff06

Please sign in to comment.