diff options
| author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-06-06 15:45:44 -0400 |
|---|---|---|
| committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-07-21 10:56:07 -0400 |
| commit | d7dd023409d01b09631e02a2dff591c847de32b3 (patch) | |
| tree | 3054b8771ca058f18429799aa29c7b39c27ad900 /src/yuzu/configuration/shared_widget.h | |
| parent | d373cc3d3ff624507d2165518eeb0616f34a8004 (diff) | |
shared_widget: Refactor again
Starting with combobox
Putting code specific to the sub-widget in their own function.
Diffstat (limited to 'src/yuzu/configuration/shared_widget.h')
| -rw-r--r-- | src/yuzu/configuration/shared_widget.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/yuzu/configuration/shared_widget.h b/src/yuzu/configuration/shared_widget.h index 6077f045d..2ed738a06 100644 --- a/src/yuzu/configuration/shared_widget.h +++ b/src/yuzu/configuration/shared_widget.h @@ -43,7 +43,7 @@ public: const QString& string = QStringLiteral("")); virtual ~Widget(); - bool Valid(); + bool Valid() const; [[nodiscard]] static QPushButton* CreateRestoreGlobalButton(bool using_global, QWidget* parent); @@ -56,12 +56,16 @@ public: QDateTimeEdit* date_time_edit{}; private: + void SetupComponent(const QString& label, std::function<void()>& load_func, bool managed, + RequestType request, Settings::BasicSetting* other_setting); + QLabel* CreateLabel(const QString& text); QHBoxLayout* CreateCheckBox(Settings::BasicSetting* bool_setting, const QString& label, std::function<void()>& load_func, bool managed); - void CreateCombobox(const QString& label, std::function<void()>& load_func, bool managed, - Settings::BasicSetting* const other_setting = nullptr); + 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, |
