mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 15:45:46 +00:00
shared_widget: Complete refactoring
Reduces code bloat a good bit by moving code specific to each sub widget to their own functions.
This commit is contained in:
parent
1d7fb41d59
commit
4e18f8dbe9
2 changed files with 169 additions and 379 deletions
|
@ -57,26 +57,32 @@ public:
|
|||
|
||||
private:
|
||||
void SetupComponent(const QString& label, std::function<void()>& load_func, bool managed,
|
||||
RequestType request, Settings::BasicSetting* other_setting);
|
||||
RequestType request, float multiplier,
|
||||
Settings::BasicSetting* other_setting, const QString& string);
|
||||
|
||||
QLabel* CreateLabel(const QString& text);
|
||||
QHBoxLayout* CreateCheckBox(Settings::BasicSetting* bool_setting, const QString& label,
|
||||
std::function<void()>& load_func, bool managed);
|
||||
QWidget* CreateCheckBox(Settings::BasicSetting* bool_setting, const QString& label,
|
||||
std::function<std::string()>& serializer,
|
||||
std::function<void()>& restore_func,
|
||||
const std::function<void()>& touch);
|
||||
|
||||
QWidget* CreateCombobox(std::function<std::string()>& serializer,
|
||||
std::function<void()>& restore_func,
|
||||
const std::function<void()>& touched);
|
||||
void CreateLineEdit(const QString& label, std::function<void()>& load_func, bool managed,
|
||||
Settings::BasicSetting* const other_setting = nullptr);
|
||||
void CreateHexEdit(const QString& label, std::function<void()>& load_func, bool managed,
|
||||
Settings::BasicSetting* const other_setting = nullptr);
|
||||
void CreateSlider(const QString& label, bool reversed, float multiplier,
|
||||
std::function<void()>& load_func, bool managed, const QString& format,
|
||||
Settings::BasicSetting* const other_setting = nullptr);
|
||||
void CreateDateTimeEdit(const QString& label, std::function<void()>& load_func, bool managed,
|
||||
bool restrict, Settings::BasicSetting* const other_setting = nullptr);
|
||||
void CreateSpinBox(const QString& label, std::function<void()>& load_func, bool managed,
|
||||
const QString& suffix, Settings::BasicSetting* other_setting = nullptr);
|
||||
const std::function<void()>& touch);
|
||||
QWidget* CreateLineEdit(std::function<std::string()>& serializer,
|
||||
std::function<void()>& restore_func, const std::function<void()>& touch,
|
||||
bool managed = true);
|
||||
QWidget* CreateHexEdit(std::function<std::string()>& serializer,
|
||||
std::function<void()>& restore_func, const std::function<void()>& touch);
|
||||
QWidget* CreateSlider(bool reversed, float multiplier, const QString& format,
|
||||
std::function<std::string()>& serializer,
|
||||
std::function<void()>& restore_func, const std::function<void()>& touch);
|
||||
QWidget* CreateDateTimeEdit(bool disabled, bool restrict,
|
||||
std::function<std::string()>& serializer,
|
||||
std::function<void()>& restore_func,
|
||||
const std::function<void()>& touch);
|
||||
QWidget* CreateSpinBox(const QString& suffix, std::function<std::string()>& serializer,
|
||||
std::function<void()>& restore_func, const std::function<void()>& touch);
|
||||
|
||||
QWidget* parent;
|
||||
const TranslationMap& translations;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue