From e26e82d8d5f9a3907b3623bd50dffd1c9b84969e Mon Sep 17 00:00:00 2001 From: lat9nq Date: Mon, 13 Jul 2020 17:08:24 -0400 Subject: 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. --- src/yuzu/configuration/configuration_shared.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/yuzu/configuration/configuration_shared.h') 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* setting, const QCheckBox* checkbox, + const CheckState& tracker); void ApplyPerGameSetting(Settings::Setting* setting, const QCheckBox* checkbox); void ApplyPerGameSetting(Settings::Setting* setting, const QComboBox* combobox); void ApplyPerGameSetting(Settings::Setting* setting, @@ -31,6 +43,10 @@ void SetPerGameSetting(QComboBox* combobox, void SetPerGameSetting(QComboBox* combobox, const Settings::Setting* setting); +void SetBGColor(QWidget* widget, bool highlighted); +void SetColoredTristate(QCheckBox* checkbox, Settings::Setting& setting, + ConfigurationShared::CheckState& tracker); + void InsertGlobalItem(QComboBox* combobox); } // namespace ConfigurationShared -- cgit v1.2.3