[vlc-commits] commit: Qt4: coverflow,	only do animation if target is under 100 items away (Ilkka Ollakka )
    git at videolan.org 
    git at videolan.org
       
    Sat Oct 30 22:01:51 CEST 2010
    
    
  
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Oct 30 23:01:03 2010 +0300| [40999732fcab5d4a089c8855f20138825cdbc692] | committer: Ilkka Ollakka 
Qt4: coverflow, only do animation if target is under 100 items away
It seems to take about 10s to scroll 100 items in my pc, and any longer than
that is just way too slow.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=40999732fcab5d4a089c8855f20138825cdbc692
---
 modules/gui/qt4/components/playlist/views.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
index 046d775..ed3cd52 100644
--- a/modules/gui/qt4/components/playlist/views.cpp
+++ b/modules/gui/qt4/components/playlist/views.cpp
@@ -403,7 +403,11 @@ QRect PicFlowView::visualRect(const QModelIndex &index ) const
 
 void PicFlowView::scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint)
 {
-     picFlow->showSlide( index.row()-1 );
+     int currentIndex = picFlow->centerIndex();
+     if( qAbs( currentIndex - index.row()) > 100 )
+        picFlow->setCenterIndex( index.row()-1);
+     else
+        picFlow->showSlide( index.row()-1 );
 }
 
 QModelIndex PicFlowView::indexAt(const QPoint &) const
    
    
More information about the vlc-commits
mailing list