Backport changes from yuzu-emu/yuzu#2057

This commit is contained in:
FearlessTobi 2019-09-22 17:47:18 +02:00
parent 0a3f75c25f
commit a5d880979c
2 changed files with 15 additions and 11 deletions

View file

@ -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<int>(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);
}

View file

@ -22,6 +22,8 @@ public:
void RetranslateUI();
void SetConfiguration();
void UpdateBackgroundColorButton(QColor color);
std::unique_ptr<Ui::ConfigureGraphics> ui;
QColor bg_color;