Skip to content

Commit 0d6641d

Browse files
author
jef
committed
keep layer selection on legend right click
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14217 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b430cf9 commit 0d6641d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/legend/qgslegend.cpp

+3-2
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)