┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistview.cpp
diff options
context:
space:
mode:
authorMarco Martin <[email protected]>2025-10-23 10:50:32 +0200
committerMarco Martin <[email protected]>2025-10-23 10:50:32 +0200
commit5ba28fbee04c0f2fa5b21cc2aa52eabc16e32f20 (patch)
treee6ebb1f363d61f6cd8cad5cfaa274dbd4b95a14c /src/kitemviews/kitemlistview.cpp
parentaa481d1fdd0cb5ad1f2d9df81d376feb2fd4d147 (diff)
Item view: don't do a zoom animation
The zoom animation in all 3 views looks very glitchy, because icons that were already in view animate, those that weren't don't animate giving weird effect. In the list view mode, the tree view branches don't animate either, showing weird holes between the branches Also, while zooming in and out very quickly, is possible to have the selection rectangle somehow unsynced with the items sizes leading to visual glitches. Without an animation, zooming the view feels much faster and robust giving immediate feedback when zooming via ctrl+scroll or by dragging the slider around BUG:510426
Diffstat (limited to 'src/kitemviews/kitemlistview.cpp')
-rw-r--r--src/kitemviews/kitemlistview.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp
index 1e4377bdc..bcfa27eaa 100644
--- a/src/kitemviews/kitemlistview.cpp
+++ b/src/kitemviews/kitemlistview.cpp
@@ -1964,35 +1964,14 @@ void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int cha
Q_ASSERT(widget->index() == i);
widget->setVisible(true);
- bool animateIconResizing = animate;
-
if (widget->size() != itemBounds.size()) {
// Resize the widget for the item to the changed size.
- if (animate) {
- // If a dynamic item size is used then no animation is done in the direction
- // of the dynamic size.
- if (m_itemSize.width() <= 0) {
- // The width is dynamic, apply the new width without animation.
- widget->resize(itemBounds.width(), widget->size().height());
- } else if (m_itemSize.height() <= 0) {
- // The height is dynamic, apply the new height without animation.
- widget->resize(widget->size().width(), itemBounds.height());
- }
- m_animation->start(widget, KItemListViewAnimation::ResizeAnimation, itemBounds.size());
- } else {
- widget->resize(itemBounds.size());
- }
- } else {
- animateIconResizing = false;
+ widget->resize(itemBounds.size());
}
const int newIconSize = widget->styleOption().iconSize;
if (widget->iconSize() != newIconSize) {
- if (animateIconResizing && !m_animation->isStarted(widget, KItemListViewAnimation::IconResizeAnimation)) {
- m_animation->start(widget, KItemListViewAnimation::IconResizeAnimation, newIconSize);
- } else {
- widget->setIconSize(newIconSize);
- }
+ widget->setIconSize(newIconSize);
}
// Updating the cell-information must be done as last step: The decision whether the