From ce26de858a022a5cdbe5a169c679b80f569504a1 Mon Sep 17 00:00:00 2001 From: xperia64 Date: Sun, 20 Jan 2019 22:09:23 -0500 Subject: [PATCH] Use QPixmap/QIcon for background color selection button --- src/citra_qt/configuration/configure_graphics.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/citra_qt/configuration/configure_graphics.cpp b/src/citra_qt/configuration/configure_graphics.cpp index 4bbb7d19f..5502e611d 100644 --- a/src/citra_qt/configuration/configure_graphics.cpp +++ b/src/citra_qt/configuration/configure_graphics.cpp @@ -47,8 +47,10 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) if (!new_bg_color.isValid()) return; bg_color = new_bg_color; - ui->bg_button->setStyleSheet( - QString("QPushButton { background-color: %1 }").arg(bg_color.name())); + QPixmap pixmap(ui->bg_button->size()); + pixmap.fill(bg_color); + const QIcon color_icon(pixmap); + ui->bg_button->setIcon(color_icon); }); } @@ -70,8 +72,10 @@ void ConfigureGraphics::setConfiguration() { ui->swap_screen->setChecked(Settings::values.swap_screen); bg_color = QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, Settings::values.bg_blue); - ui->bg_button->setStyleSheet( - QString("QPushButton { background-color: %1 }").arg(bg_color.name())); + QPixmap pixmap(ui->bg_button->size()); + pixmap.fill(bg_color); + const QIcon color_icon(pixmap); + ui->bg_button->setIcon(color_icon); } void ConfigureGraphics::applyConfiguration() {