Skip to content

Commit

Permalink
yalb (yet another legend bugfix)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4935 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 1, 2006
1 parent 25789d8 commit 85275d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/legend/qgslegend.cpp
Expand Up @@ -161,7 +161,6 @@ void QgsLegend::mouseMoveEvent(QMouseEvent * e)

// remember item we've pressed as the one being moved
// and where it was originally
//QTreeWidgetItem* item = itemAt(contentsToViewport(mLastPressPos));
QTreeWidgetItem* item = itemAt(mLastPressPos);
if(item)
{
Expand Down
15 changes: 11 additions & 4 deletions src/legend/qgslegendlayer.cpp
Expand Up @@ -78,12 +78,12 @@ QgsLegendItem::DRAG_ACTION QgsLegendLayer::accept(LEGEND_ITEM_TYPE type)
{
if ( type == LEGEND_LAYER || type == LEGEND_GROUP)
{
return REORDER;
return REORDER;
}
else
{
{
return NO_ACTION;
}
}
}

QgsLegendItem::DRAG_ACTION QgsLegendLayer::accept(const QgsLegendItem* li) const
Expand All @@ -94,7 +94,14 @@ QgsLegendItem::DRAG_ACTION QgsLegendLayer::accept(const QgsLegendItem* li) const
if(li && li != this)
{
LEGEND_ITEM_TYPE type = li->type();
if ( type == LEGEND_LAYER || type == LEGEND_GROUP)
if ( type == LEGEND_LAYER)
{
if(parent() == li->parent())
{
return REORDER;
}
}
else if(type == LEGEND_GROUP)
{
return REORDER;
}
Expand Down

0 comments on commit 85275d7

Please sign in to comment.