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; |
32 |
32 |
33 const int logsDissappearByMovingIndex = 0; |
33 const int logsDissappearByMovingIndex = 0; |
|
34 const int logsPauseBetweenDissappearAndAppearIndex = 1; |
34 const int logsAppearByMovingIndex = 2; |
35 const int logsAppearByMovingIndex = 2; |
35 |
36 |
36 // ----------------------------------------------------------------------------- |
37 // ----------------------------------------------------------------------------- |
37 // |
38 // |
38 // ----------------------------------------------------------------------------- |
39 // ----------------------------------------------------------------------------- |
70 mMoveNotPossibleGroup->addAnimation(mItemMoveNotPossibleAnimationStart); |
71 mMoveNotPossibleGroup->addAnimation(mItemMoveNotPossibleAnimationStart); |
71 mMoveNotPossibleGroup->addAnimation(mItemMoveNotPossibleAnimationEnd); |
72 mMoveNotPossibleGroup->addAnimation(mItemMoveNotPossibleAnimationEnd); |
72 |
73 |
73 connect(mMoveGroup, SIGNAL(currentAnimationChanged(QAbstractAnimation *)), |
74 connect(mMoveGroup, SIGNAL(currentAnimationChanged(QAbstractAnimation *)), |
74 this, SLOT( moveAnimationChanged(QAbstractAnimation *))); |
75 this, SLOT( moveAnimationChanged(QAbstractAnimation *))); |
|
76 connect(mMoveGroup, SIGNAL(finished()), this, SIGNAL(appearByMovingComplete()) ); |
75 connect(mFadeGroup, SIGNAL(currentAnimationChanged(QAbstractAnimation *)), |
77 connect(mFadeGroup, SIGNAL(currentAnimationChanged(QAbstractAnimation *)), |
76 this, SLOT( fadeAnimationChanged(QAbstractAnimation *))); |
78 this, SLOT( fadeAnimationChanged(QAbstractAnimation *))); |
77 |
79 |
78 LOGS_QDEBUG( "logs [UI] <- LogsEffectHandler::LogsEffectHandler()" ); |
80 LOGS_QDEBUG( "logs [UI] <- LogsEffectHandler::LogsEffectHandler()" ); |
79 } |
81 } |
99 // |
101 // |
100 // ----------------------------------------------------------------------------- |
102 // ----------------------------------------------------------------------------- |
101 // |
103 // |
102 void LogsEffectHandler::moveAnimationChanged(QAbstractAnimation *currentAnimation) |
104 void LogsEffectHandler::moveAnimationChanged(QAbstractAnimation *currentAnimation) |
103 { |
105 { |
104 if ( mMoveGroup->indexOfAnimation(currentAnimation) == 1 ) { |
106 int indexOfAnimation = mMoveGroup->indexOfAnimation(currentAnimation); |
|
107 if (indexOfAnimation == logsPauseBetweenDissappearAndAppearIndex ) { |
105 emit dissappearByMovingComplete(); |
108 emit dissappearByMovingComplete(); |
106 } |
109 } |
107 } |
110 } |
108 |
111 |
109 // ----------------------------------------------------------------------------- |
112 // ----------------------------------------------------------------------------- |
110 // |
113 // |
111 // ----------------------------------------------------------------------------- |
114 // ----------------------------------------------------------------------------- |
112 // |
115 // |
113 void LogsEffectHandler::fadeAnimationChanged(QAbstractAnimation *currentAnimation) |
116 void LogsEffectHandler::fadeAnimationChanged(QAbstractAnimation *currentAnimation) |
114 { |
117 { |
115 if ( mFadeGroup->indexOfAnimation(currentAnimation) == 1 ) { |
118 int indexOfAnimation = mFadeGroup->indexOfAnimation(currentAnimation); |
|
119 if ( indexOfAnimation == logsPauseBetweenDissappearAndAppearIndex ) { |
116 emit dissappearByFadingComplete(); |
120 emit dissappearByFadingComplete(); |
117 } |
121 } |
118 } |
122 } |
119 |
123 |
120 // ----------------------------------------------------------------------------- |
124 // ----------------------------------------------------------------------------- |
135 // |
139 // |
136 // ----------------------------------------------------------------------------- |
140 // ----------------------------------------------------------------------------- |
137 // |
141 // |
138 void LogsEffectHandler::startDissappearAppearByMovingEffect( |
142 void LogsEffectHandler::startDissappearAppearByMovingEffect( |
139 QObject& effectTarget, QObject& secondaryEffectTarget, |
143 QObject& effectTarget, QObject& secondaryEffectTarget, |
140 bool dissappearToLeft, int origX) |
144 bool dissappearToLeft, int origX, int secondaryOrigX) |
141 { |
145 { |
142 doStartDissappearAppearByMovingEffect( |
146 doStartDissappearAppearByMovingEffect( |
143 *mMoveGroup, effectTarget, dissappearToLeft, origX); |
147 *mMoveGroup, effectTarget, dissappearToLeft, origX); |
|
148 |
144 doStartDissappearAppearByMovingEffect( |
149 doStartDissappearAppearByMovingEffect( |
145 *mMoveGroup2, secondaryEffectTarget, dissappearToLeft, origX); |
150 *mMoveGroup2, secondaryEffectTarget, dissappearToLeft, secondaryOrigX); |
146 } |
151 } |
147 |
152 |
148 // ----------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
149 // |
154 // |
150 // ----------------------------------------------------------------------------- |
155 // ----------------------------------------------------------------------------- |