Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/private/kitemlistviewanimation.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 65 | while (it.hasNext()) { | |||
---|---|---|---|---|---|
70 | 70 | | |||
71 | QPointF currentPos = widget->pos(); | 71 | QPointF currentPos = widget->pos(); | ||
72 | if (m_scrollOrientation == Qt::Vertical) { | 72 | if (m_scrollOrientation == Qt::Vertical) { | ||
73 | currentPos.ry() += diff; | 73 | currentPos.ry() += diff; | ||
74 | } else { | 74 | } else { | ||
75 | currentPos.rx() += diff; | 75 | currentPos.rx() += diff; | ||
76 | } | 76 | } | ||
77 | 77 | | |||
78 | if (type == MovingAnimation) { | 78 | if (AnimationType(type) == MovingAnimation) { | ||
79 | // Stop the animation, calculate the moved start- and end-value | 79 | // Stop the animation, calculate the moved start- and end-value | ||
80 | // and restart the animation for the remaining duration. | 80 | // and restart the animation for the remaining duration. | ||
81 | const int remainingDuration = propertyAnim->duration() | 81 | const int remainingDuration = propertyAnim->duration() | ||
82 | - propertyAnim->currentTime(); | 82 | - propertyAnim->currentTime(); | ||
83 | 83 | | |||
84 | const bool block = propertyAnim->signalsBlocked(); | 84 | const bool block = propertyAnim->signalsBlocked(); | ||
85 | propertyAnim->blockSignals(true); | 85 | propertyAnim->blockSignals(true); | ||
86 | propertyAnim->stop(); | 86 | propertyAnim->stop(); | ||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | |||||
172 | 172 | | |||
173 | void KItemListViewAnimation::stop(QGraphicsWidget* widget, AnimationType type) | 173 | void KItemListViewAnimation::stop(QGraphicsWidget* widget, AnimationType type) | ||
174 | { | 174 | { | ||
175 | QPropertyAnimation* propertyAnim = m_animation[type].value(widget); | 175 | QPropertyAnimation* propertyAnim = m_animation[type].value(widget); | ||
176 | if (propertyAnim) { | 176 | if (propertyAnim) { | ||
177 | propertyAnim->stop(); | 177 | propertyAnim->stop(); | ||
178 | 178 | | |||
179 | switch (type) { | 179 | switch (type) { | ||
180 | case MovingAnimation: break; | 180 | case AnimationType::MovingAnimation: break; | ||
181 | case CreateAnimation: widget->setOpacity(1.0); break; | 181 | case AnimationType::CreateAnimation: widget->setOpacity(1.0); break; | ||
182 | case DeleteAnimation: widget->setOpacity(0.0); break; | 182 | case AnimationType::DeleteAnimation: widget->setOpacity(0.0); break; | ||
183 | case ResizeAnimation: break; | 183 | case AnimationType::ResizeAnimation: break; | ||
184 | default: break; | 184 | default: break; | ||
185 | } | 185 | } | ||
186 | 186 | | |||
187 | m_animation[type].remove(widget); | 187 | m_animation[type].remove(widget); | ||
188 | delete propertyAnim; | 188 | delete propertyAnim; | ||
189 | 189 | | |||
190 | emit finished(widget, type); | 190 | emit finished(widget, type); | ||
191 | } | 191 | } | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |