configuration_shared: Use a highlight instead of background color

Fixes visibility in the built-in dark theme
merge-requests/60/head
lat9nq 2020-07-13 17:42:13 +07:00
parent 58672cc7b6
commit 5a9dc8f002
2 changed files with 6 additions and 6 deletions

@ -85,11 +85,11 @@ void ConfigurationShared::SetPerGameSetting(
ConfigurationShared::USE_GLOBAL_OFFSET); ConfigurationShared::USE_GLOBAL_OFFSET);
} }
void ConfigurationShared::SetBGColor(QWidget* widget, bool highlighted) { void ConfigurationShared::SetHighlight(QWidget* widget, bool highlighted) {
if (highlighted) { if (highlighted) {
widget->setStyleSheet(QStringLiteral("background-color:rgba(0,203,255,0.5);")); widget->setStyleSheet(QStringLiteral("border:2px solid;border-color:rgba(0,203,255,0.5);"));
} else { } else {
widget->setStyleSheet(QStringLiteral("background-color:rgba(0,0,0,0);")); widget->setStyleSheet(QStringLiteral("border:2px solid;border-color:rgba(0,0,0,0);"));
} }
widget->show(); widget->show();
} }
@ -101,13 +101,13 @@ void ConfigurationShared::SetColoredTristate(QCheckBox* checkbox, Settings::Sett
} else { } else {
tracker = (setting.GetValue() == setting.GetValue(true)) ? CheckState::On : CheckState::Off; tracker = (setting.GetValue() == setting.GetValue(true)) ? CheckState::On : CheckState::Off;
} }
SetBGColor(checkbox, tracker != CheckState::Global); SetHighlight(checkbox, tracker != CheckState::Global);
QObject::connect(checkbox, &QCheckBox::clicked, checkbox, [checkbox, setting, &tracker]() { QObject::connect(checkbox, &QCheckBox::clicked, checkbox, [checkbox, setting, &tracker]() {
tracker = static_cast<ConfigurationShared::CheckState>((tracker + 1) % CheckState::Count); tracker = static_cast<ConfigurationShared::CheckState>((tracker + 1) % CheckState::Count);
if (tracker == CheckState::Global) { if (tracker == CheckState::Global) {
checkbox->setChecked(setting.GetValue(true)); checkbox->setChecked(setting.GetValue(true));
} }
SetBGColor(checkbox, tracker != CheckState::Global); SetHighlight(checkbox, tracker != CheckState::Global);
}); });
} }

@ -45,7 +45,7 @@ void SetPerGameSetting(QComboBox* combobox,
void SetPerGameSetting(QComboBox* combobox, void SetPerGameSetting(QComboBox* combobox,
const Settings::Setting<Settings::GPUAccuracy>* setting); const Settings::Setting<Settings::GPUAccuracy>* setting);
void SetBGColor(QWidget* widget, bool highlighted); void SetHighlight(QWidget* widget, bool highlighted);
void SetColoredTristate(QCheckBox* checkbox, Settings::Setting<bool>& setting, void SetColoredTristate(QCheckBox* checkbox, Settings::Setting<bool>& setting,
ConfigurationShared::CheckState& tracker); ConfigurationShared::CheckState& tracker);