Commit 7b878f5a authored by Ilkka Ollakka's avatar Ilkka Ollakka
Browse files

Qt4: when in tree-like playlist, scroll previous rootitem to be visible

This hopefully helps on scrollin bigger playlists as view is not always
back on top.
parent 764ff17a
......@@ -203,8 +203,19 @@ void StandardPLPanel::browseInto( const QModelIndex &index )
{
if( currentView == iconView || currentView == listView || currentView == picFlowView )
{
currentRootIndexId = model->itemId( index );
currentView->setRootIndex( index );
/* When going toward root in LocationBar, scroll to the item
that was previously as root */
QModelIndex newIndex = model->index(currentRootIndexId,0);
while( newIndex.isValid() && (newIndex.parent() != index) )
newIndex = newIndex.parent();
if( newIndex.isValid() )
currentView->scrollTo( newIndex );
/* Store new rootindexid*/
currentRootIndexId = model->itemId( index );
}
emit viewChanged( index );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment