Commit 94bbf13f authored by Eugene Popov's avatar Eugene Popov 🇺🇦 Committed by Felix Ernst
Browse files

Fix icon resize animation

This MR fixes an issue where, under certain conditions, an icon resize animation is performed that shouldn't be there.
parent 2834e581
Pipeline #170446 passed with stage
in 1 minute and 49 seconds
......@@ -1858,6 +1858,8 @@ 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) {
......@@ -1874,11 +1876,13 @@ void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int cha
} else {
widget->resize(itemBounds.size());
}
} else {
animateIconResizing = false;
}
const int newIconSize = widget->styleOption().iconSize;
if (widget->iconSize() != newIconSize) {
if (animate) {
if (animateIconResizing) {
m_animation->start(widget, KItemListViewAnimation::IconResizeAnimation, newIconSize);
} else {
widget->setIconSize(newIconSize);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment