Skip to content

Commit

Permalink
Turn on scrolling in legend layers
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11237 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Aug 1, 2009
1 parent 7423b30 commit 2cb735b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -249,6 +249,8 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
QTreeWidgetItem* item = itemAt( p );

hideLine();
updateLineWidget();
scrollToItem (item );

QgsLegendItem* origin = dynamic_cast<QgsLegendItem*>( mItemBeingMoved );
QgsLegendItem* dest = dynamic_cast<QgsLegendItem*>( item );
Expand Down Expand Up @@ -1992,6 +1994,12 @@ void QgsLegend::showLine(int y, int left)
mInsertionLine->setGeometry(left, y, viewport()->width(), 2);
}

void QgsLegend::updateLineWidget()
{
mInsertionLine->repaint();
}


QTreeWidgetItem * QgsLegend::lastVisibleItem()
{
QTreeWidgetItem *current;
Expand Down
3 changes: 3 additions & 0 deletions src/app/legend/qgslegend.h
Expand Up @@ -319,6 +319,9 @@ class QgsLegend : public QTreeWidget
/** Show the line that indicates insertion position */
void showLine(int y, int left);

/** Update the widget with latest changes immediately */
void updateLineWidget();

/** Returns the last visible item in the tree widget */
QTreeWidgetItem *lastVisibleItem();

Expand Down

0 comments on commit 2cb735b

Please sign in to comment.