From 4e2f3dcffe2c2388e9d2d63e626ee6d03abce953 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 28 May 2012 23:10:20 +0200 Subject: Implement dropping of items into the Places Panel Some polishing regarding the icons and group-alignment must still be done, but at least the basic functionality is back again. --- src/kitemviews/kitemlistview.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistview.cpp') diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index ee69c8990..5f4c54606 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -1616,6 +1616,11 @@ void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int cha } if (animate) { + if (m_animation->isStarted(widget, KItemListViewAnimation::MovingAnimation)) { + m_animation->start(widget, KItemListViewAnimation::MovingAnimation, newPos); + applyNewPos = false; + } + const bool itemsRemoved = (changedCount < 0); const bool itemsInserted = (changedCount > 0); if (itemsRemoved && (i >= changedIndex + changedCount + 1)) { @@ -2330,7 +2335,8 @@ int KItemListView::showDropIndicator(const QPointF& pos) } } - return -1; + const QRectF firstItemRect = itemRect(firstVisibleIndex()); + return (pos.y() <= firstItemRect.top()) ? 0 : -1; } void KItemListView::hideDropIndicator() -- cgit v1.3