Skip to content

Commit

Permalink
keep layer selection on legend right click
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14217 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 10, 2010
1 parent b430cf9 commit 0d6641d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ void QgsLegend::mousePressEvent( QMouseEvent * e )
else if ( e->button() == Qt::RightButton )
{
QTreeWidgetItem* item = itemAt( e->pos() );
setCurrentItem( item );
handleRightClickEvent( item, e->globalPos() );
if ( item == currentItem() )
handleRightClickEvent( item, e->globalPos() );
}
QTreeWidget::mousePressEvent( e );
} // contentsMousePressEvent
Expand Down Expand Up @@ -622,6 +622,7 @@ bool QgsLegend::setCurrentLayer( QgsMapLayer *layer )
return false;

setCurrentItem( ll );
clearSelection();
return true;
}

Expand Down

0 comments on commit 0d6641d

Please sign in to comment.