aboutsummaryrefslogtreecommitdiff
path: root/src/animationlayer.cpp
diff options
context:
space:
mode:
authorTrickyLeifa <date.epoch@gmail.com>2024-05-23 00:02:07 +0200
committerTrickyLeifa <date.epoch@gmail.com>2024-05-23 00:02:07 +0200
commit29284c0b21408131b280744f58b78b2792d6a826 (patch)
treed664f474696f4728a4ba75600fff57d24650097e /src/animationlayer.cpp
parentd135bbc51144667fb3ee323a7635e3dbfc3f41a8 (diff)
Removed theme submodule, ...
* Removed theme submodule. * This should be handled by the CI. * Fixed effects not disappearing when they should (cull / repeat)
Diffstat (limited to 'src/animationlayer.cpp')
-rw-r--r--src/animationlayer.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/animationlayer.cpp b/src/animationlayer.cpp
index a21e20c4..708aef26 100644
--- a/src/animationlayer.cpp
+++ b/src/animationlayer.cpp
@@ -143,6 +143,11 @@ void AnimationLayer::jumpToFrame(int number)
}
}
+bool AnimationLayer::isPlayOnce()
+{
+ return m_play_once;
+}
+
void AnimationLayer::setPlayOnce(bool enabled)
{
m_play_once = enabled;
@@ -324,6 +329,7 @@ void AnimationLayer::frameTicker()
return;
}
+ stopPlayback();
return;
}
@@ -595,11 +601,20 @@ void BackgroundAnimationLayer::loadAndPlayAnimation(QString fileName)
}
#endif
- setFileName(file_path);
+ bool is_different_file = file_path != this->fileName();
+ if (is_different_file)
+ {
+ setFileName(file_path);
+ }
+
VPath design_path = ao_app->get_background_path("design.ini");
setTransformationMode(ao_app->get_scaling(ao_app->read_design_ini("scaling", design_path)));
setStretchToFit(ao_app->read_design_ini("stretch", design_path).startsWith("true"));
- startPlayback();
+
+ if (is_different_file)
+ {
+ startPlayback();
+ }
}
SplashAnimationLayer::SplashAnimationLayer(AOApplication *ao_app, QWidget *parent)
@@ -640,7 +655,7 @@ void EffectAnimationLayer::setHideWhenStopped(bool enabled)
void EffectAnimationLayer::maybeHide()
{
- if (m_hide_when_stopped)
+ if (m_hide_when_stopped && isPlayOnce())
{
hide();
}