diff options
| author | Crystalwarrior <Varsash@Gmail.com> | 2020-07-31 23:07:14 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-31 15:07:14 -0500 |
| commit | 56d7fff50044ef72626ac40ccf13da1e34b5f0a1 (patch) | |
| tree | a1b7e75046275a34565cf1a5d3c7ff7372eaa825 /src | |
| parent | 740d825fd2ac34e052b8cd69f7fd86cea75e324d (diff) | |
Fix reload theme breaking BG sizing (#212)
May need additional testing with animated BGs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/aoscene.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/aoscene.cpp b/src/aoscene.cpp index 094d7a54..594013a1 100644 --- a/src/aoscene.cpp +++ b/src/aoscene.cpp @@ -24,14 +24,14 @@ void AOScene::set_image(QString p_image) return; } - if (file_exists(background_path) && background_path == last_image) - return; - - this->clear(); - this->setMovie(nullptr); + if (!file_exists(background_path) || background_path != last_image) + { + this->clear(); + this->setMovie(nullptr); - m_movie->stop(); - m_movie->setFileName(background_path); + m_movie->stop(); + m_movie->setFileName(background_path); + } if (m_movie->isValid() && m_movie->frameCount() > 1) { m_movie->jumpToNextFrame(); @@ -43,9 +43,12 @@ void AOScene::set_image(QString p_image) m_movie->setScaledSize(QSize(n_w, n_h)); this->resize(m_movie->scaledSize()); - this->setMovie(m_movie); + if (!file_exists(background_path) || background_path != last_image) + { + this->setMovie(m_movie); + m_movie->start(); + } QLabel::move(x + (f_w - n_w) / 2, y + (f_h - n_h) / 2); // Center - m_movie->start(); } else { QPixmap background(background_path); |
