┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
Diffstat (limited to 'src/kitemviews')
-rw-r--r--src/kitemviews/kitemlistview.cpp8
-rw-r--r--src/kitemviews/kitemlistview.h3
2 files changed, 9 insertions, 2 deletions
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()
diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h
index de40791da..5723b9aaa 100644
--- a/src/kitemviews/kitemlistview.h
+++ b/src/kitemviews/kitemlistview.h
@@ -634,7 +634,8 @@ private:
* Shows a drop-indicator between items dependent on the given
* cursor position. The cursor position is relative the the upper left
* edge of the view.
- * @return Index of the item where the dropping is done.
+ * @return Index of the item where the dropping is done. An index of -1
+ * indicates that the item has been dropped after the last item.
*/
int showDropIndicator(const QPointF& pos);
void hideDropIndicator();