mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-24 17:01:48 +01:00
Backport changes from yuzu-emu/yuzu#2057
This commit is contained in:
parent
0a3f75c25f
commit
a5d880979c
@ -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);
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ public:
|
||||
void RetranslateUI();
|
||||
void SetConfiguration();
|
||||
|
||||
void UpdateBackgroundColorButton(QColor color);
|
||||
|
||||
std::unique_ptr<Ui::ConfigureGraphics> ui;
|
||||
QColor bg_color;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user