From d7dd023409d01b09631e02a2dff591c847de32b3 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Tue, 6 Jun 2023 15:45:44 -0400 Subject: shared_widget: Refactor again Starting with combobox Putting code specific to the sub-widget in their own function. --- src/yuzu/configuration/shared_widget.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/yuzu/configuration/shared_widget.h') 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& 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& load_func, bool managed); - void CreateCombobox(const QString& label, std::function& load_func, bool managed, - Settings::BasicSetting* const other_setting = nullptr); + QWidget* CreateCombobox(std::function& serializer, + std::function& restore_func, + const std::function& touched); void CreateLineEdit(const QString& label, std::function& load_func, bool managed, Settings::BasicSetting* const other_setting = nullptr); void CreateHexEdit(const QString& label, std::function& load_func, bool managed, -- cgit v1.2.3