21 //SYSTEM |
21 //SYSTEM |
22 #include <QPropertyAnimation> |
22 #include <QPropertyAnimation> |
23 #include <QSequentialAnimationGroup> |
23 #include <QSequentialAnimationGroup> |
24 #include <hbinstance.h> |
24 #include <hbinstance.h> |
25 |
25 |
26 const int logsMoveByExtra = 20; |
26 const int logsMoveByExtra = 10; |
27 const int logsEffectDelayBetween = 200; |
27 const int logsEffectDelayBetween = 200; |
28 const int logsEffectAppearDurationInMs = 500; |
28 const int logsEffectAppearDurationInMs = 500; |
29 const int logsEffectDissappearDurationInMs = 300; |
29 const int logsEffectDissappearDurationInMs = 300; |
30 const int logsEffectMoveNotPossibleDurationInMs = 200; |
30 const int logsEffectMoveNotPossibleDurationInMs = 200; |
31 const int logsMoveNotPossibleAmount = 30; |
31 const int logsMoveNotPossibleAmount = 30; |
102 // ----------------------------------------------------------------------------- |
102 // ----------------------------------------------------------------------------- |
103 // |
103 // |
104 void LogsEffectHandler::moveAnimationChanged(QAbstractAnimation *currentAnimation) |
104 void LogsEffectHandler::moveAnimationChanged(QAbstractAnimation *currentAnimation) |
105 { |
105 { |
106 int indexOfAnimation = mMoveGroup->indexOfAnimation(currentAnimation); |
106 int indexOfAnimation = mMoveGroup->indexOfAnimation(currentAnimation); |
107 if (indexOfAnimation == logsPauseBetweenDissappearAndAppearIndex ) { |
107 if (indexOfAnimation == logsPauseBetweenDissappearAndAppearIndex ) { |
108 emit dissappearByMovingComplete(); |
108 emit dissappearByMovingComplete(); |
|
109 } else if (indexOfAnimation == logsAppearByMovingIndex ) { |
|
110 emit appearStarting(); |
109 } |
111 } |
110 } |
112 } |
111 |
113 |
112 // ----------------------------------------------------------------------------- |
114 // ----------------------------------------------------------------------------- |
113 // |
115 // |
203 QPropertyAnimation& animation, QObject* effectTarget, bool appearFromLeft, int origX) |
205 QPropertyAnimation& animation, QObject* effectTarget, bool appearFromLeft, int origX) |
204 { |
206 { |
205 LOGS_QDEBUG( "logs [UI] -> LogsEffectHandler::startAppearByMovingEffect()" ); |
207 LOGS_QDEBUG( "logs [UI] -> LogsEffectHandler::startAppearByMovingEffect()" ); |
206 |
208 |
207 Q_ASSERT(!hbInstance->allMainWindows().isEmpty()); |
209 Q_ASSERT(!hbInstance->allMainWindows().isEmpty()); |
208 int moveBy = hbInstance->allMainWindows().at(0)->layoutRect().width() + logsMoveByExtra; |
210 int moveBy = hbInstance->allMainWindows().at(0)->layoutRect().width() - logsMoveByExtra; |
209 int startPos = appearFromLeft ? -moveBy : moveBy; |
211 int startPos = appearFromLeft ? -moveBy : moveBy; |
210 QEasingCurve easing(QEasingCurve::OutQuad); // decelerating |
212 QEasingCurve easing(QEasingCurve::OutQuad); // decelerating |
211 initMoveHorizontallyEffect( |
213 initMoveHorizontallyEffect( |
212 animation, effectTarget, startPos, origX, |
214 animation, effectTarget, startPos, origX, |
213 logsEffectAppearDurationInMs, easing); |
215 logsEffectAppearDurationInMs, easing); |
214 |
216 |
215 LOGS_QDEBUG( "logs [UI] <- LogsEffectHandler::startAppearByMovingEffect()" ); |
217 LOGS_QDEBUG( "logs [UI] <- LogsEffectHandler::startAppearByMovingEffect()" ); |
216 } |
218 } |
217 |
219 |
218 // ----------------------------------------------------------------------------- |
220 // ----------------------------------------------------------------------------- |
219 // |
221 // |