configuration_shared: Simplify name lookup in highlighting functions

We can query the given object name directly from the widget itself. This
removes any potential for forgetting to change the name if the widget
gets renamed and makes the API much simpler (just pass in the widget,
and not worry about its name).
This commit is contained in:
Lioncash 2020-08-14 14:02:37 -04:00
parent f482b4b40d
commit fe86109877
7 changed files with 74 additions and 90 deletions

View file

@ -39,13 +39,12 @@ void SetPerGameSetting(QComboBox* combobox,
void SetPerGameSetting(QComboBox* combobox,
const Settings::Setting<Settings::GPUAccuracy>* setting);
void SetHighlight(QWidget* widget, const std::string& name, bool highlighted);
void SetColoredTristate(QCheckBox* checkbox, const std::string& name,
const Settings::Setting<bool>& setting, CheckState& tracker);
void SetColoredTristate(QCheckBox* checkbox, const std::string& name, bool global, bool state,
bool global_state, CheckState& tracker);
void SetColoredComboBox(QComboBox* combobox, QWidget* target, const std::string& target_name,
int global);
void SetHighlight(QWidget* widget, bool highlighted);
void SetColoredTristate(QCheckBox* checkbox, const Settings::Setting<bool>& setting,
CheckState& tracker);
void SetColoredTristate(QCheckBox* checkbox, bool global, bool state, bool global_state,
CheckState& tracker);
void SetColoredComboBox(QComboBox* combobox, QWidget* target, int global);
void InsertGlobalItem(QComboBox* combobox, int global_index);