From d05ffe96f986bcd33281cb5f97b73c1b4bf2b2ae Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 29 Jan 2012 18:29:00 +0100 Subject: Make moving animations less obtrusive Only animate the moving of items if the new position is within the same row or the same column. Otherwise just fade in the icon on the new position. This makes the the animations when resizing the window or changing the zoom-level a lot more pleasant. CCBUG: 289238 --- src/kitemviews/kitemlistview.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/kitemviews/kitemlistview.h') diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 4969d01b7..e4f1cd0d9 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -344,6 +344,22 @@ private: void doLayout(LayoutAnimationHint hint, int changedIndex = 0, int changedCount = 0); + /** + * Helper method for doLayout: Returns a list of items that can be reused for the visible + * area. Invisible group headers get recycled. The reusable items are items that are + * invisible and not animated. Reusing items is faster in comparison to deleting invisible + * items and creating a new instance for visible items. + */ + QList recycleInvisibleItems(int firstVisibleIndex, int lastVisibleIndex); + + /** + * Helper method for doLayout: Starts a moving-animation for the widget to the given + * new position. The moving-animation is only started if the new position is within + * the same row or column, otherwise the create-animation is used instead. + * @return True if the moving-animation has been applied. + */ + bool moveWidget(KItemListWidget* widget, const QPointF& newPos); + void emitOffsetChanges(); KItemListWidget* createWidget(int index); -- cgit v1.3