aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/configuration/shared_widget.h
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2023-06-06 21:20:37 -0400
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2023-07-21 10:56:07 -0400
commit4e18f8dbe9f3a0681c80b1877bbe18fe2afd61ba (patch)
tree1de0d04e5273e0ef0b6290a26eb75f56c63d8644 /src/yuzu/configuration/shared_widget.h
parent1d7fb41d59bd76c67c617faf76e90d482b2f013e (diff)
shared_widget: Complete refactoring
Reduces code bloat a good bit by moving code specific to each sub widget to their own functions.
Diffstat (limited to 'src/yuzu/configuration/shared_widget.h')
-rw-r--r--src/yuzu/configuration/shared_widget.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/yuzu/configuration/shared_widget.h b/src/yuzu/configuration/shared_widget.h
index 2ed738a06b..01348e4428 100644
--- a/src/yuzu/configuration/shared_widget.h
+++ b/src/yuzu/configuration/shared_widget.h
@@ -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;