[vlc-commits] Qt4: when in tree-like playlist, scroll previous rootitem to be visible
Ilkka Ollakka
git at videolan.org
Mon Apr 16 14:36:45 CEST 2012
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Apr 16 15:34:27 2012 +0300| [7b878f5ab0aa91255e1cd6a834852c9a9b23055a] | committer: Ilkka Ollakka
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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b878f5ab0aa91255e1cd6a834852c9a9b23055a
---
.../gui/qt4/components/playlist/standardpanel.cpp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 29dd9e1..badb68c 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -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 );
More information about the vlc-commits
mailing list