Skip to content

Commit ea2ff06

Browse files
committedJan 23, 2017
[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.
1 parent 7a0fa23 commit ea2ff06

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed
 

‎src/gui/qgscomposerview.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void QgsComposerView::mousePressEvent( QMouseEvent* e )
290290

291291
case Zoom:
292292
{
293-
if ( !( e->modifiers() & Qt::ShiftModifier ) )
293+
if ( !( e->modifiers() & Qt::AltModifier ) )
294294
{
295295
//zoom in action
296296
startMarqueeZoom( scenePoint );
@@ -1706,7 +1706,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
17061706
{
17071707
//both control and space pressed
17081708
//set cursor to zoom in/out depending on shift key status
1709-
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
1709+
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
17101710
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
17111711
viewport()->setCursor( zoomCursor );
17121712
}
@@ -1740,8 +1740,8 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
17401740
mTemporaryZoomStatus = QgsComposerView::Active;
17411741
mPreviousTool = mCurrentTool;
17421742
setCurrentTool( Zoom );
1743-
//set cursor to zoom in/out depending on shift key status
1744-
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
1743+
//set cursor to zoom in/out depending on alt key status
1744+
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
17451745
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
17461746
viewport()->setCursor( zoomCursor );
17471747
return;
@@ -1750,10 +1750,10 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
17501750

17511751
if ( mCurrentTool == QgsComposerView::Zoom )
17521752
{
1753-
//using the zoom tool, respond to changes in shift key status and update mouse cursor accordingly
1753+
//using the zoom tool, respond to changes in alt key status and update mouse cursor accordingly
17541754
if ( ! e->isAutoRepeat() )
17551755
{
1756-
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
1756+
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
17571757
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
17581758
viewport()->setCursor( zoomCursor );
17591759
}
@@ -1939,10 +1939,10 @@ void QgsComposerView::keyReleaseEvent( QKeyEvent * e )
19391939
}
19401940
else if ( mCurrentTool == QgsComposerView::Zoom )
19411941
{
1942-
//if zoom tool is active, respond to changes in the shift key status and update cursor accordingly
1942+
//if zoom tool is active, respond to changes in the alt key status and update cursor accordingly
19431943
if ( ! e->isAutoRepeat() )
19441944
{
1945-
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::ShiftModifier ) ? zoom_out : zoom_in ) );
1945+
QPixmap myZoomQPixmap = QPixmap(( const char ** )(( e->modifiers() & Qt::AltModifier ) ? zoom_out : zoom_in ) );
19461946
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
19471947
viewport()->setCursor( zoomCursor );
19481948
}

‎src/gui/qgsmaptoolzoom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void QgsMapToolZoom::canvasReleaseEvent( QgsMapMouseEvent* e )
8484
return;
8585

8686
bool zoomOut = mZoomOut;
87-
if ( e->modifiers() & Qt::ShiftModifier )
87+
if ( e->modifiers() & Qt::AltModifier )
8888
zoomOut = !zoomOut;
8989

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

0 commit comments

Comments
 (0)
Please sign in to comment.