From 2bbcf819c88feba39a2c77ddc3e69f29069e4faf Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 17 Mar 2018 14:39:06 +0100 Subject: [PATCH] Add background_initialized_ --- src/playlist/playlistview.cpp | 6 ++++-- src/playlist/playlistview.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 45d120172..63dedfa8c 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -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; diff --git a/src/playlist/playlistview.h b/src/playlist/playlistview.h index cbfca5fd0..d30c50352 100644 --- a/src/playlist/playlistview.h +++ b/src/playlist/playlistview.h @@ -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