From c03f69daa79ddaf296fc4e49eec1a18bb0c756e7 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sun, 17 Feb 2013 13:55:54 +1100 Subject: [PATCH] Restore the blur amount setting when the settings dialog is loaded. Also remove some unusued variables. Fixes issue 3497 --- src/playlist/playlistview.h | 1 - src/ui/appearancesettingspage.cpp | 11 ++++------- src/ui/appearancesettingspage.h | 2 -- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/playlist/playlistview.h b/src/playlist/playlistview.h index 4b38c0279..79421a174 100644 --- a/src/playlist/playlistview.h +++ b/src/playlist/playlistview.h @@ -73,7 +73,6 @@ class PlaylistView : public QTreeView { // Constants for settings: are persistent, values should not be changed static const char* kSettingBackgroundImageType; static const char* kSettingBackgroundImageFilename; - static const int kSettingBackgroundBlurLevel; static ColumnAlignmentMap DefaultColumnAlignment(); diff --git a/src/ui/appearancesettingspage.cpp b/src/ui/appearancesettingspage.cpp index 59d216960..a4157ef9e 100644 --- a/src/ui/appearancesettingspage.cpp +++ b/src/ui/appearancesettingspage.cpp @@ -51,13 +51,14 @@ AppearanceSettingsPage::AppearanceSettingsPage(SettingsDialog* dialog) ui_->setupUi(this); setWindowIcon(IconLoader::Load("view-media-visualization")); + connect(ui_->blur_slider, SIGNAL(valueChanged(int)), SLOT(BlurLevelChanged(int))); + connect(ui_->opacity_slider, SIGNAL(valueChanged(int)), SLOT(OpacityLevelChanged(int))); + Load(); connect(ui_->select_foreground_color, SIGNAL(pressed()), SLOT(SelectForegroundColor())); connect(ui_->select_background_color, SIGNAL(pressed()), SLOT(SelectBackgroundColor())); connect(ui_->use_a_custom_color_set, SIGNAL(toggled(bool)), SLOT(UseCustomColorSetOptionChanged(bool))); - connect(ui_->blur_slider, SIGNAL(valueChanged(int)), SLOT(BlurLevelChanged(int))); - connect(ui_->opacity_slider, SIGNAL(valueChanged(int)), SLOT(OpacityLevelChanged(int))); connect(ui_->select_background_image_filename_button, SIGNAL(pressed()), SLOT(SelectBackgroundImage())); connect(ui_->use_custom_background_image, SIGNAL(toggled(bool)), @@ -128,10 +129,8 @@ void AppearanceSettingsPage::Load() { DisableBlurSlider(true); } ui_->background_image_filename->setText(playlist_view_background_image_filename_); - /* There has to be a way to just simulate the change... */ + ui_->blur_slider->setValue(s.value("blur_radius").toInt()); ui_->opacity_slider->setValue(s.value("opacity_level").toInt()); - OpacityLevelChanged(s.value("opacity_level").toInt()); - s.endGroup(); @@ -254,12 +253,10 @@ void AppearanceSettingsPage::SelectBackgroundImage() { } void AppearanceSettingsPage::BlurLevelChanged(int value) { - background_blur_radius_ = value; ui_->background_blur_radius_label->setText(QString("%1px").arg(value)); } void AppearanceSettingsPage::OpacityLevelChanged(int percent) { - background_opacity_level_ = percent; ui_->background_opacity_label->setText(QString("%1\%").arg(percent)); } diff --git a/src/ui/appearancesettingspage.h b/src/ui/appearancesettingspage.h index 8bf0af246..1e252b34e 100644 --- a/src/ui/appearancesettingspage.h +++ b/src/ui/appearancesettingspage.h @@ -65,8 +65,6 @@ private: QColor current_background_color_; PlaylistView::BackgroundImageType playlist_view_background_image_type_; QString playlist_view_background_image_filename_; - int background_blur_radius_; - int background_opacity_level_; bool initialised_moodbar_previews_; };