diff options
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 20 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.h | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 8290b4384..d21f95469 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -62,9 +62,7 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) | |||
| 62 | const QColor new_bg_color = QColorDialog::getColor(bg_color); | 62 | const QColor new_bg_color = QColorDialog::getColor(bg_color); |
| 63 | if (!new_bg_color.isValid()) | 63 | if (!new_bg_color.isValid()) |
| 64 | return; | 64 | return; |
| 65 | bg_color = new_bg_color; | 65 | UpdateBackgroundColorButton(new_bg_color); |
| 66 | ui->bg_button->setStyleSheet( | ||
| 67 | QString("QPushButton { background-color: %1 }").arg(bg_color.name())); | ||
| 68 | }); | 66 | }); |
| 69 | } | 67 | } |
| 70 | 68 | ||
| @@ -76,10 +74,8 @@ void ConfigureGraphics::setConfiguration() { | |||
| 76 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit); | 74 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit); |
| 77 | ui->frame_limit->setValue(Settings::values.frame_limit); | 75 | ui->frame_limit->setValue(Settings::values.frame_limit); |
| 78 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); | 76 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); |
| 79 | bg_color = QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, | 77 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, |
| 80 | Settings::values.bg_blue); | 78 | Settings::values.bg_blue)); |
| 81 | ui->bg_button->setStyleSheet( | ||
| 82 | QString("QPushButton { background-color: %1 }").arg(bg_color.name())); | ||
| 83 | } | 79 | } |
| 84 | 80 | ||
| 85 | void ConfigureGraphics::applyConfiguration() { | 81 | void ConfigureGraphics::applyConfiguration() { |
| @@ -92,3 +88,13 @@ void ConfigureGraphics::applyConfiguration() { | |||
| 92 | Settings::values.bg_green = static_cast<float>(bg_color.greenF()); | 88 | Settings::values.bg_green = static_cast<float>(bg_color.greenF()); |
| 93 | Settings::values.bg_blue = static_cast<float>(bg_color.blueF()); | 89 | Settings::values.bg_blue = static_cast<float>(bg_color.blueF()); |
| 94 | } | 90 | } |
| 91 | |||
| 92 | void ConfigureGraphics::UpdateBackgroundColorButton(QColor color) { | ||
| 93 | bg_color = color; | ||
| 94 | |||
| 95 | QPixmap pixmap(ui->bg_button->size()); | ||
| 96 | pixmap.fill(bg_color); | ||
| 97 | |||
| 98 | const QIcon color_icon(pixmap); | ||
| 99 | ui->bg_button->setIcon(color_icon); | ||
| 100 | } | ||
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index d6ffc6fde..f2799822d 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h | |||
| @@ -23,6 +23,8 @@ public: | |||
| 23 | private: | 23 | private: |
| 24 | void setConfiguration(); | 24 | void setConfiguration(); |
| 25 | 25 | ||
| 26 | void UpdateBackgroundColorButton(QColor color); | ||
| 27 | |||
| 26 | std::unique_ptr<Ui::ConfigureGraphics> ui; | 28 | std::unique_ptr<Ui::ConfigureGraphics> ui; |
| 27 | QColor bg_color; | 29 | QColor bg_color; |
| 28 | }; | 30 | }; |