Fix background not loading.

This commit is contained in:
Jonas Kvinge 2018-03-10 00:12:36 +01:00 committed by John Maguire
parent de23c3181f
commit c393926be6
2 changed files with 8 additions and 3 deletions

View File

@ -112,7 +112,9 @@ PlaylistView::PlaylistView(QWidget* parent)
upgrading_from_qheaderview_(false),
read_only_settings_(true),
upgrading_from_version_(-1),
background_initialized_(false),
background_image_type_(Default),
//background_image_filename_("_"),
blur_radius_(kDefaultBlurRadius),
opacity_level_(kDefaultOpacityLevel),
previous_background_image_opacity_(0.0),
@ -1127,10 +1129,11 @@ void PlaylistView::ReloadSettings() {
// set_background_image when it is not needed, as this will cause the fading
// animation to start again. This also avoid to do useless
// "force_background_redraw".
if (background_image_filename != background_image_filename_ ||
if (background_initialized_ == false || background_image_filename != background_image_filename_ ||
background_type != background_image_type_ ||
blur_radius_ != blur_radius || opacity_level_ != opacity_level) {
// Store background properties
background_initialized_ = true;
background_image_type_ = background_type;
background_image_filename_ = background_image_filename;
blur_radius_ = blur_radius;

View File

@ -195,15 +195,17 @@ signals:
bool read_only_settings_;
int upgrading_from_version_;
bool background_initialized_;
BackgroundImageType background_image_type_;
// Used if background image is a filemane
QString background_image_filename_;
// Stores the background image to be displayed. As we want this image to be
// particular (in terms of format, opacity), you should probably use
// set_background_image_type instead of modifying background_image_ directly
QImage background_image_;
int blur_radius_;
int opacity_level_;
// Used if background image is a filemane
QString background_image_filename_;
QImage current_song_cover_art_;
QPixmap cached_scaled_background_image_;