From 189736c1a96a1ad0e571ad69f01039e96455011a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 22 Feb 2025 13:31:51 +0100 Subject: Add option to take a screenshot (default hotkey: alt+f1) --- include/gui/ScreenshotSettingsPage.hpp | 78 ++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 include/gui/ScreenshotSettingsPage.hpp (limited to 'include/gui/ScreenshotSettingsPage.hpp') diff --git a/include/gui/ScreenshotSettingsPage.hpp b/include/gui/ScreenshotSettingsPage.hpp new file mode 100644 index 0000000..1cfbf00 --- /dev/null +++ b/include/gui/ScreenshotSettingsPage.hpp @@ -0,0 +1,78 @@ +#pragma once + +#include "StaticPage.hpp" +#include "List.hpp" +#include "ComboBox.hpp" +#include "Entry.hpp" +#include "CheckBox.hpp" +#include "../GsrInfo.hpp" +#include "../Config.hpp" + +namespace gsr { + class PageStack; + class GsrPage; + class ScrollablePage; + class Button; + + class ScreenshotSettingsPage : public StaticPage { + public: + ScreenshotSettingsPage(const GsrInfo *gsr_info, Config &config, PageStack *page_stack); + ScreenshotSettingsPage(const ScreenshotSettingsPage&) = delete; + ScreenshotSettingsPage& operator=(const ScreenshotSettingsPage&) = delete; + + void load(); + void save(); + void on_navigate_away_from_page() override; + private: + std::unique_ptr create_record_area_box(); + std::unique_ptr create_record_area(); + std::unique_ptr create_select_window(); + std::unique_ptr create_image_width_entry(); + std::unique_ptr create_image_height_entry(); + std::unique_ptr create_image_resolution(); + std::unique_ptr create_image_resolution_section(); + std::unique_ptr create_restore_portal_session_checkbox(); + std::unique_ptr create_restore_portal_session_section(); + std::unique_ptr create_change_image_resolution_section(); + std::unique_ptr create_capture_target_section(); + std::unique_ptr create_image_quality_section(); + std::unique_ptr create_record_cursor_section(); + std::unique_ptr create_image_section(); + std::unique_ptr create_save_directory(const char *label); + std::unique_ptr create_image_format_box(); + std::unique_ptr create_image_format_section(); + std::unique_ptr create_file_info_section(); + std::unique_ptr create_save_screenshot_in_game_folder(); + std::unique_ptr create_general_section(); + std::unique_ptr create_notifications_section(); + std::unique_ptr create_settings(); + void add_widgets(); + + void save(RecordOptions &record_options); + private: + Config &config; + const GsrInfo *gsr_info = nullptr; + SupportedCaptureOptions capture_options; + + GsrPage *content_page_ptr = nullptr; + ScrollablePage *settings_scrollable_page_ptr = nullptr; + List *select_window_list_ptr = nullptr; + List *image_resolution_list_ptr = nullptr; + List *restore_portal_session_list_ptr = nullptr; + List *color_range_list_ptr = nullptr; + Widget *image_format_ptr = nullptr; + ComboBox *record_area_box_ptr = nullptr; + Entry *image_width_entry_ptr = nullptr; + Entry *image_height_entry_ptr = nullptr; + CheckBox *record_cursor_checkbox_ptr = nullptr; + CheckBox *restore_portal_session_checkbox_ptr = nullptr; + CheckBox *change_image_resolution_checkbox_ptr = nullptr; + ComboBox *image_quality_box_ptr = nullptr; + ComboBox *image_format_box_ptr = nullptr; + Button *save_directory_button_ptr = nullptr; + CheckBox *save_screenshot_in_game_folder_checkbox_ptr = nullptr; + CheckBox *show_screenshot_saved_notification_checkbox_ptr = nullptr; + + PageStack *page_stack = nullptr; + }; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2