mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Fix icon resize animation
This MR fixes an issue where, under certain conditions, an icon resize animation is performed that shouldn't be there.
This commit is contained in:
parent
2834e581e0
commit
94bbf13ff7
|
@ -1858,6 +1858,8 @@ void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int cha
|
||||||
Q_ASSERT(widget->index() == i);
|
Q_ASSERT(widget->index() == i);
|
||||||
widget->setVisible(true);
|
widget->setVisible(true);
|
||||||
|
|
||||||
|
bool animateIconResizing = animate;
|
||||||
|
|
||||||
if (widget->size() != itemBounds.size()) {
|
if (widget->size() != itemBounds.size()) {
|
||||||
// Resize the widget for the item to the changed size.
|
// Resize the widget for the item to the changed size.
|
||||||
if (animate) {
|
if (animate) {
|
||||||
|
@ -1874,11 +1876,13 @@ void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int cha
|
||||||
} else {
|
} else {
|
||||||
widget->resize(itemBounds.size());
|
widget->resize(itemBounds.size());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
animateIconResizing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int newIconSize = widget->styleOption().iconSize;
|
const int newIconSize = widget->styleOption().iconSize;
|
||||||
if (widget->iconSize() != newIconSize) {
|
if (widget->iconSize() != newIconSize) {
|
||||||
if (animate) {
|
if (animateIconResizing) {
|
||||||
m_animation->start(widget, KItemListViewAnimation::IconResizeAnimation, newIconSize);
|
m_animation->start(widget, KItemListViewAnimation::IconResizeAnimation, newIconSize);
|
||||||
} else {
|
} else {
|
||||||
widget->setIconSize(newIconSize);
|
widget->setIconSize(newIconSize);
|
||||||
|
|
Loading…
Reference in a new issue