diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 15a0203dd..88ca32a98 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -54,6 +54,9 @@ const int PlaylistView::kDropIndicatorGradientWidth = 5; const char* PlaylistView::kSettingBackgroundImageType = "playlistview_background_type"; const char* PlaylistView::kSettingBackgroundImageFilename = "playlistview_background_image_file"; +const int PlaylistView::kDefaultBlurRadius = 0; +const int PlaylistView::kDefaultOpacityLevel = 40; + PlaylistProxyStyle::PlaylistProxyStyle(QStyle* base) : QProxyStyle(base), @@ -1015,8 +1018,8 @@ void PlaylistView::ReloadSettings() { } } QString background_image_filename = s.value(kSettingBackgroundImageFilename).toString(); - int blur_radius = s.value("blur_radius").toInt(); - int opacity_level = s.value("opacity_level").toInt(); + int blur_radius = s.value("blur_radius", kDefaultBlurRadius).toInt(); + int opacity_level = s.value("opacity_level", kDefaultOpacityLevel).toInt(); // Check if background properties have changed. // We change properties only if they have actually changed, to avoid to call // set_background_image when it is not needed, as this will cause the fading diff --git a/src/playlist/playlistview.h b/src/playlist/playlistview.h index 79421a174..6b897188c 100644 --- a/src/playlist/playlistview.h +++ b/src/playlist/playlistview.h @@ -59,7 +59,6 @@ private: class PlaylistView : public QTreeView { Q_OBJECT public: - enum BackgroundImageType { Default, None, @@ -74,6 +73,9 @@ class PlaylistView : public QTreeView { static const char* kSettingBackgroundImageType; static const char* kSettingBackgroundImageFilename; + static const int kDefaultBlurRadius; + static const int kDefaultOpacityLevel; + static ColumnAlignmentMap DefaultColumnAlignment(); void SetApplication(Application* app); diff --git a/src/ui/appearancesettingspage.cpp b/src/ui/appearancesettingspage.cpp index a4157ef9e..f5dea127a 100644 --- a/src/ui/appearancesettingspage.cpp +++ b/src/ui/appearancesettingspage.cpp @@ -129,8 +129,10 @@ void AppearanceSettingsPage::Load() { DisableBlurSlider(true); } ui_->background_image_filename->setText(playlist_view_background_image_filename_); - ui_->blur_slider->setValue(s.value("blur_radius").toInt()); - ui_->opacity_slider->setValue(s.value("opacity_level").toInt()); + ui_->blur_slider->setValue( + s.value("blur_radius", PlaylistView::kDefaultBlurRadius).toInt()); + ui_->opacity_slider->setValue( + s.value("opacity_level", PlaylistView::kDefaultOpacityLevel).toInt()); s.endGroup(); diff --git a/src/ui/appearancesettingspage.ui b/src/ui/appearancesettingspage.ui index 41b2749a6..c5764ac06 100644 --- a/src/ui/appearancesettingspage.ui +++ b/src/ui/appearancesettingspage.ui @@ -90,42 +90,30 @@ Background image - + - - - - - Default background image - - - - + + + Default background image + + - - - - - The album cover of the currently playing song - - - Album cover - - - - + + + The album cover of the currently playing song + + + Album cover + + - - - - - No background image - - - - + + + No background image + + @@ -156,28 +144,18 @@ - - + + true - Select blur radius: + Blur amount - - - - true - - - 0px - - - - + 0 @@ -185,9 +163,6 @@ 10 - - 0 - Qt::Horizontal @@ -199,35 +174,47 @@ - - - - - + + + + true + + + 0px + + + + - Opacity level: + Opacity - - - - 40% - - - - + 100 - - 40 + + 10 Qt::Horizontal + + QSlider::TicksBelow + + + 10 + + + + + + + 40% +