diff options
| author | Peter Penz <[email protected]> | 2012-01-29 18:29:00 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-01-29 18:31:57 +0100 |
| commit | d05ffe96f986bcd33281cb5f97b73c1b4bf2b2ae (patch) | |
| tree | 863fb589e8a9a7775d91526ed583abcc8d5b719c /src/kitemviews/kitemlistview.h | |
| parent | d23475a7268f6a6d9d7b3a895e1996689032a0b5 (diff) | |
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
Diffstat (limited to 'src/kitemviews/kitemlistview.h')
| -rw-r--r-- | src/kitemviews/kitemlistview.h | 16 |
1 files changed, 16 insertions, 0 deletions
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<int> 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); |
