diff options
| author | 2020-07-13 17:42:13 -0400 | |
|---|---|---|
| committer | 2020-07-19 13:26:55 -0400 | |
| commit | 5a9dc8f002c68e4af1fab9b7cfbd65e86ee2d110 (patch) | |
| tree | e00b33e1e21ac99dfddecfa6da3c0c404ac107c7 /src | |
| parent | configure_general: Implement manual tristate buttons (diff) | |
| download | yuzu-5a9dc8f002c68e4af1fab9b7cfbd65e86ee2d110.tar.gz yuzu-5a9dc8f002c68e4af1fab9b7cfbd65e86ee2d110.tar.xz yuzu-5a9dc8f002c68e4af1fab9b7cfbd65e86ee2d110.zip | |
configuration_shared: Use a highlight instead of background color
Fixes visibility in the built-in dark theme
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configuration_shared.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/configuration/configuration_shared.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index f32fcf3b7..78dd76c6e 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp | |||
| @@ -85,11 +85,11 @@ void ConfigurationShared::SetPerGameSetting( | |||
| 85 | ConfigurationShared::USE_GLOBAL_OFFSET); | 85 | ConfigurationShared::USE_GLOBAL_OFFSET); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | void ConfigurationShared::SetBGColor(QWidget* widget, bool highlighted) { | 88 | void ConfigurationShared::SetHighlight(QWidget* widget, bool highlighted) { |
| 89 | if (highlighted) { | 89 | if (highlighted) { |
| 90 | widget->setStyleSheet(QStringLiteral("background-color:rgba(0,203,255,0.5);")); | 90 | widget->setStyleSheet(QStringLiteral("border:2px solid;border-color:rgba(0,203,255,0.5);")); |
| 91 | } else { | 91 | } else { |
| 92 | widget->setStyleSheet(QStringLiteral("background-color:rgba(0,0,0,0);")); | 92 | widget->setStyleSheet(QStringLiteral("border:2px solid;border-color:rgba(0,0,0,0);")); |
| 93 | } | 93 | } |
| 94 | widget->show(); | 94 | widget->show(); |
| 95 | } | 95 | } |
| @@ -101,13 +101,13 @@ void ConfigurationShared::SetColoredTristate(QCheckBox* checkbox, Settings::Sett | |||
| 101 | } else { | 101 | } else { |
| 102 | tracker = (setting.GetValue() == setting.GetValue(true)) ? CheckState::On : CheckState::Off; | 102 | tracker = (setting.GetValue() == setting.GetValue(true)) ? CheckState::On : CheckState::Off; |
| 103 | } | 103 | } |
| 104 | SetBGColor(checkbox, tracker != CheckState::Global); | 104 | SetHighlight(checkbox, tracker != CheckState::Global); |
| 105 | QObject::connect(checkbox, &QCheckBox::clicked, checkbox, [checkbox, setting, &tracker]() { | 105 | QObject::connect(checkbox, &QCheckBox::clicked, checkbox, [checkbox, setting, &tracker]() { |
| 106 | tracker = static_cast<ConfigurationShared::CheckState>((tracker + 1) % CheckState::Count); | 106 | tracker = static_cast<ConfigurationShared::CheckState>((tracker + 1) % CheckState::Count); |
| 107 | if (tracker == CheckState::Global) { | 107 | if (tracker == CheckState::Global) { |
| 108 | checkbox->setChecked(setting.GetValue(true)); | 108 | checkbox->setChecked(setting.GetValue(true)); |
| 109 | } | 109 | } |
| 110 | SetBGColor(checkbox, tracker != CheckState::Global); | 110 | SetHighlight(checkbox, tracker != CheckState::Global); |
| 111 | }); | 111 | }); |
| 112 | } | 112 | } |
| 113 | 113 | ||
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index 4f0166fae..88709446c 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h | |||
| @@ -45,7 +45,7 @@ void SetPerGameSetting(QComboBox* combobox, | |||
| 45 | void SetPerGameSetting(QComboBox* combobox, | 45 | void SetPerGameSetting(QComboBox* combobox, |
| 46 | const Settings::Setting<Settings::GPUAccuracy>* setting); | 46 | const Settings::Setting<Settings::GPUAccuracy>* setting); |
| 47 | 47 | ||
| 48 | void SetBGColor(QWidget* widget, bool highlighted); | 48 | void SetHighlight(QWidget* widget, bool highlighted); |
| 49 | void SetColoredTristate(QCheckBox* checkbox, Settings::Setting<bool>& setting, | 49 | void SetColoredTristate(QCheckBox* checkbox, Settings::Setting<bool>& setting, |
| 50 | ConfigurationShared::CheckState& tracker); | 50 | ConfigurationShared::CheckState& tracker); |
| 51 | 51 | ||