diff options
author | lat9nq <lat9nq@virginia.edu> | 2020-07-13 17:08:24 -0400 |
---|---|---|
committer | lat9nq <lat9nq@virginia.edu> | 2020-07-19 13:26:55 -0400 |
commit | e26e82d8d5f9a3907b3623bd50dffd1c9b84969e (patch) | |
tree | 7dcd7e9dc01a56cecfded796479c63b1b330befd /src/yuzu/configuration/configuration_shared.h | |
parent | ad0b2951250979549082fdef3ba4fd93a720b5df (diff) |
configuration_shared: Initial functions and data for manual tristate
Sets up initial support for implementing colored tristate functions. These functions color a QWidget blue when it's overriding a global setting, and discolor it when not. The lack of color indicates it uses the global state, replacing the Qt::CheckState::PartiallyChecked state with the global state.
Diffstat (limited to 'src/yuzu/configuration/configuration_shared.h')
-rw-r--r-- | src/yuzu/configuration/configuration_shared.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index b11b1b950..1163604bf 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h @@ -15,8 +15,20 @@ constexpr int USE_GLOBAL_INDEX = 0; constexpr int USE_GLOBAL_SEPARATOR_INDEX = 1; constexpr int USE_GLOBAL_OFFSET = 2; +enum CheckState { + Off, + On, + Global, + Count, +}; + +struct Trackers { +} extern trackers; + // Global-aware apply and set functions +void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox, + const CheckState& tracker); void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox); void ApplyPerGameSetting(Settings::Setting<int>* setting, const QComboBox* combobox); void ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting, @@ -31,6 +43,10 @@ void SetPerGameSetting(QComboBox* combobox, void SetPerGameSetting(QComboBox* combobox, const Settings::Setting<Settings::GPUAccuracy>* setting); +void SetBGColor(QWidget* widget, bool highlighted); +void SetColoredTristate(QCheckBox* checkbox, Settings::Setting<bool>& setting, + ConfigurationShared::CheckState& tracker); + void InsertGlobalItem(QComboBox* combobox); } // namespace ConfigurationShared |