From c393926be6be0f242407a128b77d38e72bc676b7 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 10 Mar 2018 00:12:36 +0100 Subject: [PATCH] Fix background not loading. --- src/playlist/playlistview.cpp | 5 ++++- src/playlist/playlistview.h | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 7346c2e9e..c0ceaa96e 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -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; diff --git a/src/playlist/playlistview.h b/src/playlist/playlistview.h index 8784ba83a..beea33ea3 100644 --- a/src/playlist/playlistview.h +++ b/src/playlist/playlistview.h @@ -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_;