Fix reload theme breaking BG sizing (#212)
May need additional testing with animated BGs.
This commit is contained in:
parent
740d825fd2
commit
56d7fff500
@ -24,14 +24,14 @@ void AOScene::set_image(QString p_image)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(background_path) && background_path == last_image)
|
if (!file_exists(background_path) || background_path != last_image)
|
||||||
return;
|
{
|
||||||
|
|
||||||
this->clear();
|
this->clear();
|
||||||
this->setMovie(nullptr);
|
this->setMovie(nullptr);
|
||||||
|
|
||||||
m_movie->stop();
|
m_movie->stop();
|
||||||
m_movie->setFileName(background_path);
|
m_movie->setFileName(background_path);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_movie->isValid() && m_movie->frameCount() > 1) {
|
if (m_movie->isValid() && m_movie->frameCount() > 1) {
|
||||||
m_movie->jumpToNextFrame();
|
m_movie->jumpToNextFrame();
|
||||||
@ -43,10 +43,13 @@ void AOScene::set_image(QString p_image)
|
|||||||
|
|
||||||
m_movie->setScaledSize(QSize(n_w, n_h));
|
m_movie->setScaledSize(QSize(n_w, n_h));
|
||||||
this->resize(m_movie->scaledSize());
|
this->resize(m_movie->scaledSize());
|
||||||
|
if (!file_exists(background_path) || background_path != last_image)
|
||||||
|
{
|
||||||
this->setMovie(m_movie);
|
this->setMovie(m_movie);
|
||||||
QLabel::move(x + (f_w - n_w) / 2, y + (f_h - n_h) / 2); // Center
|
|
||||||
m_movie->start();
|
m_movie->start();
|
||||||
}
|
}
|
||||||
|
QLabel::move(x + (f_w - n_w) / 2, y + (f_h - n_h) / 2); // Center
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
QPixmap background(background_path);
|
QPixmap background(background_path);
|
||||||
auto transform_mode = Qt::FastTransformation;
|
auto transform_mode = Qt::FastTransformation;
|
||||||
|
Loading…
Reference in New Issue
Block a user