configuration: Move CreateWidget to a class

We were passing so many objects between the function and the caller that
it needed to be redesigned.
This commit is contained in:
lat9nq 2023-05-08 22:37:03 -04:00
parent f9310ec1e8
commit b17ab4d1d5
10 changed files with 507 additions and 453 deletions

View file

@ -13,8 +13,6 @@
#include "common/settings.h"
#include "yuzu/configuration/shared_translation.h"
class QPushButton;
namespace ConfigurationShared {
class Tab : public QWidget {
@ -43,22 +41,6 @@ enum class CheckState {
Count, // Simply the number of states, not a valid checkbox state
};
enum class RequestType {
Default,
ComboBox,
SpinBox,
Slider,
ReverseSlider,
LineEdit,
MaxEnum,
};
std::tuple<QWidget*, void*, QPushButton*> CreateWidget(
Settings::BasicSetting* setting, const TranslationMap& translations, QWidget* parent,
bool runtime_lock, std::forward_list<std::function<void(bool)>>& apply_funcs,
RequestType request = RequestType::Default, bool managed = true, float multiplier = 1.0f,
const std::string& text_box_default = "");
// Global-aware apply and set functions
// ApplyPerGameSetting, given a Settings::Setting and a Qt UI element, properly applies a Setting