From b709805cfac4d1fe1bfe28e497a3e48e224372a8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 7 Aug 2024 20:32:59 +0200 Subject: Move settings ui to SettingsPage class, show different widgets for different settings page, show different widgets depending on combobox selections --- include/SettingsPage.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 include/SettingsPage.hpp (limited to 'include/SettingsPage.hpp') diff --git a/include/SettingsPage.hpp b/include/SettingsPage.hpp new file mode 100644 index 0000000..aec7bed --- /dev/null +++ b/include/SettingsPage.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include "gui/StaticPage.hpp" +#include "GsrInfo.hpp" + +#include + +namespace gsr { + class ScrollablePage; + class List; + + class SettingsPage { + public: + enum class Type { + REPLAY, + RECORD, + STREAM + }; + + SettingsPage(Type type, const GsrInfo &gsr_info, const std::vector &audio_devices, std::function back_button_callback); + SettingsPage(const SettingsPage&) = delete; + SettingsPage& operator=(const SettingsPage&) = delete; + + Page& get_page(); + private: + void add_widgets(const gsr::GsrInfo &gsr_info, const std::vector &audio_devices, std::function back_button_callback); + void add_page_specific_widgets(); + void add_replay_widgets(); + void add_record_widgets(); + void add_stream_widgets(); + private: + StaticPage page; + ScrollablePage *content_page_ptr = nullptr; + List *settings_list_ptr = nullptr; + Type type; + }; +} \ No newline at end of file -- cgit v1.2.3