Add background_initialized_

This commit is contained in:
Jonas Kvinge
2018-03-17 14:39:06 +01:00
parent dadd5e05a3
commit 2bbcf819c8
2 changed files with 5 additions and 3 deletions

View File

@@ -109,7 +109,8 @@ PlaylistView::PlaylistView(QWidget *parent)
upgrading_from_qheaderview_(false),
read_only_settings_(true),
upgrading_from_version_(-1),
background_image_type_(Invalid),
background_initialized_(false),
background_image_type_(Default),
blur_radius_(kDefaultBlurRadius),
opacity_level_(kDefaultOpacityLevel),
previous_background_image_opacity_(0.0),
@@ -983,7 +984,8 @@ void PlaylistView::ReloadSettings() {
// animation to start again. This also avoid to do useless
// "force_background_redraw".
if (background_image_filename != background_image_filename_ || background_type != background_image_type_ || blur_radius_ != blur_radius || opacity_level_ != opacity_level) {
if (!background_initialized_ || background_image_filename != background_image_filename_ || background_type != background_image_type_ || blur_radius_ != blur_radius || opacity_level_ != opacity_level) {
background_initialized_ = true;
// Store background properties
background_image_type_ = background_type;
background_image_filename_ = background_image_filename;

View File

@@ -59,7 +59,6 @@ class PlaylistView : public QTreeView {
Q_OBJECT
public:
enum BackgroundImageType {
Invalid,
Default,
None,
Custom,
@@ -189,6 +188,7 @@ class PlaylistView : public QTreeView {
bool read_only_settings_;
int upgrading_from_version_;
bool background_initialized_;
BackgroundImageType background_image_type_;
// Stores the background image to be displayed. As we want this image to be
// particular (in terms of format, opacity), you should probably use