diff --git a/src/citra_qt/configuration/configure_graphics.cpp b/src/citra_qt/configuration/configure_graphics.cpp index ff8af9fe87..191450f740 100644 --- a/src/citra_qt/configuration/configure_graphics.cpp +++ b/src/citra_qt/configuration/configure_graphics.cpp @@ -49,11 +49,7 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) if (!new_bg_color.isValid()) { return; } - bg_color = new_bg_color; - QPixmap pixmap(ui->bg_button->size()); - pixmap.fill(bg_color); - const QIcon color_icon(pixmap); - ui->bg_button->setIcon(color_icon); + UpdateBackgroundColorButton(new_bg_color); }); } @@ -71,12 +67,8 @@ void ConfigureGraphics::SetConfiguration() { ui->toggle_linear_filter->setChecked(Settings::values.filter_mode); ui->layout_combobox->setCurrentIndex(static_cast(Settings::values.layout_option)); ui->swap_screen->setChecked(Settings::values.swap_screen); - bg_color = QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, - Settings::values.bg_blue); - QPixmap pixmap(ui->bg_button->size()); - pixmap.fill(bg_color); - const QIcon color_icon(pixmap); - ui->bg_button->setIcon(color_icon); + UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, + Settings::values.bg_blue)); } void ConfigureGraphics::ApplyConfiguration() { @@ -117,6 +109,16 @@ void ConfigureGraphics::updateShaders(bool anaglyph) { } } +void ConfigureGraphics::UpdateBackgroundColorButton(QColor color) { + bg_color = color; + + QPixmap pixmap(ui->bg_button->size()); + pixmap.fill(bg_color); + + const QIcon color_icon(pixmap); + ui->bg_button->setIcon(color_icon); +} + void ConfigureGraphics::RetranslateUI() { ui->retranslateUi(this); } diff --git a/src/citra_qt/configuration/configure_graphics.h b/src/citra_qt/configuration/configure_graphics.h index f2fb3b0b08..9f7cc55654 100644 --- a/src/citra_qt/configuration/configure_graphics.h +++ b/src/citra_qt/configuration/configure_graphics.h @@ -22,6 +22,8 @@ public: void RetranslateUI(); void SetConfiguration(); + void UpdateBackgroundColorButton(QColor color); + std::unique_ptr ui; QColor bg_color;