@@ -28,23 +28,23 @@ Animate::Animate(QWidget *parent) : QWidget(parent)
2828 const auto scrollMargins = scrollAreaWidgetContents->layout ()->contentsMargins ();
2929 const auto parameterMargins = groupBoxParameter->layout ()->contentsMargins ();
3030 initMinWidth = width + margins.left () + margins.right () + scrollMargins.left () + scrollMargins.right ()
31- + parameterMargins.left () + parameterMargins.right ();
31+ + parameterMargins.left () + parameterMargins.right ();
3232}
3333
3434void Animate::initGUI ()
3535{
36- this ->animStep = 0 ;
37- this ->animNumSteps = 0 ;
36+ this ->animStep = 0 ;
37+ this ->animNumSteps = 0 ;
3838 this ->animTVal = 0.0 ;
39- this ->animDumping = false ;
39+ this ->animDumping = false ;
4040 this ->animDumpStartStep = 0 ;
4141
4242 this ->iconRun = QIcon::fromTheme (" chokusen-animate-play" );
4343 this ->iconPause = QIcon::fromTheme (" chokusen-animate-pause" );
4444 this ->iconDisabled = QIcon::fromTheme (" chokusen-animate-disabled" );
4545
46- animateTimer = new QTimer (this );
47- connect (animateTimer, SIGNAL (timeout ()), this , SLOT (incrementTVal ()));
46+ animateTimer = new QTimer (this );
47+ connect (animateTimer, SIGNAL (timeout ()), this , SLOT (incrementTVal ()));
4848
4949 connect (this ->e_tval , SIGNAL (textChanged (QString)), this , SLOT (updatedAnimTval ()));
5050 connect (this ->e_fps , SIGNAL (textChanged (QString)), this , SLOT (updatedAnimFpsAndAnimSteps ()));
@@ -72,9 +72,9 @@ void Animate::connectAction(QAction *action, QPushButton *button)
7272
7373void Animate::updatedAnimTval ()
7474{
75- double t = this ->e_tval ->text ().toDouble (&this ->tOK );
75+ double t = this ->e_tval ->text ().toDouble (&this ->tOK );
7676 // Clamp t to 0-1
77- if (this ->tOK ) {
77+ if (this ->tOK ) {
7878 t = t < 0 ? 0.0 : ((t > 1.0 ) ? 1.0 : t);
7979 } else {
8080 t = 0.0 ;
@@ -88,23 +88,23 @@ void Animate::updatedAnimTval()
8888
8989void Animate::updatedAnimFpsAndAnimSteps ()
9090{
91- animateTimer->stop ();
91+ animateTimer->stop ();
9292
9393 int numsteps = this ->e_fsteps ->text ().toInt (&this ->steps_ok );
9494 if (this ->steps_ok ) {
95- this ->animNumSteps = numsteps;
95+ this ->animNumSteps = numsteps;
9696 } else {
97- this ->animNumSteps = 0 ;
97+ this ->animNumSteps = 0 ;
9898 }
9999 this ->animDumping = false ;
100100
101101 double fps = this ->e_fps ->text ().toDouble (&this ->fpsOK );
102102 animateTimer->stop ();
103103 if (this ->fpsOK && fps > 0 && this ->animNumSteps > 0 ) {
104- this ->animStep = int (this ->animTVal * this ->animNumSteps ) % this ->animNumSteps ;
105- animateTimer->setSingleShot (false );
106- animateTimer->setInterval (int (1000 / fps));
107- animateTimer->start ();
104+ this ->animStep = int (this ->animTVal * this ->animNumSteps ) % this ->animNumSteps ;
105+ animateTimer->setSingleShot (false );
106+ animateTimer->setInterval (int (1000 / fps));
107+ animateTimer->start ();
108108 }
109109
110110 QPalette defaultPalette;
@@ -129,25 +129,25 @@ void Animate::updatedAnimFpsAndAnimSteps()
129129
130130void Animate::updatedAnimDump (bool checked)
131131{
132- if (!checked) this ->animDumping = false ;
132+ if (!checked) this ->animDumping = false ;
133133
134134 updatePauseButtonIcon ();
135135}
136136
137137// Only called from animate_timer
138138void Animate::incrementTVal ()
139139{
140- if (this ->animNumSteps == 0 ) return ;
140+ if (this ->animNumSteps == 0 ) return ;
141141
142- if (mainWindow->windowActionHideCustomizer ->isVisible ()) {
142+ if (mainWindow->parameterDock ->isVisible ()) {
143143 if (mainWindow->activeEditor ->parameterWidget ->childHasFocus ()) return ;
144144 }
145145
146146 if (this ->animNumSteps > 1 ) {
147- this ->animStep = (this ->animStep + 1 ) % this ->animNumSteps ;
148- this ->animTVal = 1.0 * this ->animStep / this ->animNumSteps ;
147+ this ->animStep = (this ->animStep + 1 ) % this ->animNumSteps ;
148+ this ->animTVal = 1.0 * this ->animStep / this ->animNumSteps ;
149149 } else if (this ->animNumSteps > 0 ) {
150- this ->animStep = 0 ;
150+ this ->animStep = 0 ;
151151 this ->animTVal = 0.0 ;
152152 }
153153
@@ -159,17 +159,17 @@ void Animate::incrementTVal()
159159
160160void Animate::updateTVal ()
161161{
162- if (this ->animNumSteps == 0 ) return ;
162+ if (this ->animNumSteps == 0 ) return ;
163163
164164 if (this ->animStep < 0 ) {
165- this ->animStep = this ->animNumSteps - this ->animStep - 2 ;
165+ this ->animStep = this ->animNumSteps - this ->animStep - 2 ;
166166 }
167167
168168 if (this ->animNumSteps > 1 ) {
169- this ->animStep = (this ->animStep ) % this ->animNumSteps ;
170- this ->animTVal = 1.0 * this ->animStep / this ->animNumSteps ;
169+ this ->animStep = (this ->animStep ) % this ->animNumSteps ;
170+ this ->animTVal = 1.0 * this ->animStep / this ->animNumSteps ;
171171 } else if (this ->animNumSteps > 0 ) {
172- this ->animStep = 0 ;
172+ this ->animStep = 0 ;
173173 this ->animTVal = 0.0 ;
174174 }
175175
@@ -180,14 +180,14 @@ void Animate::updateTVal()
180180}
181181
182182void Animate::pauseAnimation (){
183- animateTimer->stop ();
183+ animateTimer->stop ();
184184 updatePauseButtonIcon ();
185185}
186186
187187void Animate::on_pauseButton_pressed ()
188188{
189- if (animateTimer->isActive ()) {
190- animateTimer->stop ();
189+ if (animateTimer->isActive ()) {
190+ animateTimer->stop ();
191191 updatePauseButtonIcon ();
192192 } else {
193193 this ->updatedAnimFpsAndAnimSteps ();
@@ -196,7 +196,7 @@ void Animate::on_pauseButton_pressed()
196196
197197void Animate::updatePauseButtonIcon ()
198198{
199- if (animateTimer->isActive ()) {
199+ if (animateTimer->isActive ()) {
200200 pauseButton->setIcon (this ->iconPause );
201201 pauseButton->setToolTip (_ (" press to pause animation" ) );
202202 } else {
@@ -223,29 +223,29 @@ void Animate::animateUpdate()
223223 if (mainWindow->animateDockContents ->isVisible ()) {
224224 double fps = this ->e_fps ->text ().toDouble (&this ->fpsOK );
225225 if (this ->fpsOK && fps <= 0 && !animateTimer->isActive ()) {
226- animateTimer->stop ();
227- animateTimer->setSingleShot (true );
228- animateTimer->setInterval (50 );
229- animateTimer->start ();
226+ animateTimer->stop ();
227+ animateTimer->setSingleShot (true );
228+ animateTimer->setInterval (50 );
229+ animateTimer->start ();
230230 }
231231 }
232232}
233233
234234bool Animate::dumpPictures (){
235- return this ->e_dump ->isChecked () && this ->animateTimer ->isActive ();
235+ return this ->e_dump ->isChecked () && this ->animateTimer ->isActive ();
236236}
237237
238238int Animate::nextFrame (){
239- if (animDumping && animDumpStartStep == animStep) {
240- animDumping = false ;
239+ if (animDumping && animDumpStartStep == animStep) {
240+ animDumping = false ;
241241 e_dump->setChecked (false );
242242 } else {
243- if (!animDumping) {
244- animDumping = true ;
245- animDumpStartStep = animStep;
243+ if (!animDumping) {
244+ animDumping = true ;
245+ animDumpStartStep = animStep;
246246 }
247247 }
248- return animStep;
248+ return animStep;
249249}
250250
251251void Animate::resizeEvent (QResizeEvent *event)
0 commit comments