summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yuzu/configuration/configuration_shared.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h
index 5b344cdbd..0072dfe7f 100644
--- a/src/yuzu/configuration/configuration_shared.h
+++ b/src/yuzu/configuration/configuration_shared.h
@@ -15,23 +15,24 @@ constexpr int USE_GLOBAL_INDEX = 0;
15constexpr int USE_GLOBAL_SEPARATOR_INDEX = 1; 15constexpr int USE_GLOBAL_SEPARATOR_INDEX = 1;
16constexpr int USE_GLOBAL_OFFSET = 2; 16constexpr int USE_GLOBAL_OFFSET = 2;
17 17
18// CheckBoxes require a tracker for their state since we emulate a tristate CheckBox
18enum class CheckState { 19enum class CheckState {
19 Off, 20 Off, // Checkbox overrides to off/false
20 On, 21 On, // Checkbox overrides to on/true
21 Global, 22 Global, // Checkbox defers to the global state
22 Count, 23 Count, // Simply the number of states, not a valid checkbox state
23}; 24};
24 25
25// Global-aware apply and set functions 26// Global-aware apply and set functions
26 27
28// ApplyPerGameSetting, given a Settings::Setting and a Qt UI element, properly applies a Setting
27void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox, 29void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox,
28 const CheckState& tracker); 30 const CheckState& tracker);
29void ApplyPerGameSetting(Settings::Setting<int>* setting, const QComboBox* combobox); 31void ApplyPerGameSetting(Settings::Setting<int>* setting, const QComboBox* combobox);
30void ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting, 32void ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting,
31 const QComboBox* combobox); 33 const QComboBox* combobox);
32void ApplyPerGameSetting(Settings::Setting<Settings::GPUAccuracy>* setting,
33 const QComboBox* combobox);
34 34
35// Sets a Qt UI element given a Settings::Setting
35void SetPerGameSetting(QCheckBox* checkbox, const Settings::Setting<bool>* setting); 36void SetPerGameSetting(QCheckBox* checkbox, const Settings::Setting<bool>* setting);
36void SetPerGameSetting(QComboBox* combobox, const Settings::Setting<int>* setting); 37void SetPerGameSetting(QComboBox* combobox, const Settings::Setting<int>* setting);
37void SetPerGameSetting(QComboBox* combobox, 38void SetPerGameSetting(QComboBox* combobox,
@@ -39,13 +40,20 @@ void SetPerGameSetting(QComboBox* combobox,
39void SetPerGameSetting(QComboBox* combobox, 40void SetPerGameSetting(QComboBox* combobox,
40 const Settings::Setting<Settings::GPUAccuracy>* setting); 41 const Settings::Setting<Settings::GPUAccuracy>* setting);
41 42
43// (Un)highlights a Qt UI element
42void SetHighlight(QWidget* widget, bool highlighted); 44void SetHighlight(QWidget* widget, bool highlighted);
45
46// Sets up a QCheckBox like a tristate one, given a Setting
43void SetColoredTristate(QCheckBox* checkbox, const Settings::Setting<bool>& setting, 47void SetColoredTristate(QCheckBox* checkbox, const Settings::Setting<bool>& setting,
44 CheckState& tracker); 48 CheckState& tracker);
45void SetColoredTristate(QCheckBox* checkbox, bool global, bool state, bool global_state, 49void SetColoredTristate(QCheckBox* checkbox, bool global, bool state, bool global_state,
46 CheckState& tracker); 50 CheckState& tracker);
51
52// Sets up coloring of a QWidget `target` based on the state of a QComboBox, and calls
53// InsertGlobalItem
47void SetColoredComboBox(QComboBox* combobox, QWidget* target, int global); 54void SetColoredComboBox(QComboBox* combobox, QWidget* target, int global);
48 55
56// Adds the "Use Global Configuration" selection and separator to the beginning of a QComboBox
49void InsertGlobalItem(QComboBox* combobox, int global_index); 57void InsertGlobalItem(QComboBox* combobox, int global_index);
50 58
51} // namespace ConfigurationShared 59} // namespace ConfigurationShared