Skip to content

Commit 6428982

Browse files
author
jef
committedSep 10, 2010
keep layer selection on legend right click
git-svn-id: http://svn.osgeo.org/qgis/trunk@14217 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 53447de commit 6428982

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/app/legend/qgslegend.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ void QgsLegend::mousePressEvent( QMouseEvent * e )
218218
else if ( e->button() == Qt::RightButton )
219219
{
220220
QTreeWidgetItem* item = itemAt( e->pos() );
221-
setCurrentItem( item );
222-
handleRightClickEvent( item, e->globalPos() );
221+
if ( item == currentItem() )
222+
handleRightClickEvent( item, e->globalPos() );
223223
}
224224
QTreeWidget::mousePressEvent( e );
225225
} // contentsMousePressEvent
@@ -622,6 +622,7 @@ bool QgsLegend::setCurrentLayer( QgsMapLayer *layer )
622622
return false;
623623

624624
setCurrentItem( ll );
625+
clearSelection();
625626
return true;
626627
}
627628

0 commit comments

Comments
 (0)
Please sign in to comment.