mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-05 22:40:44 +09:00
Add option to take a screenshot (default hotkey: alt+f1)
This commit is contained in:
@@ -30,6 +30,7 @@ namespace gsr {
|
||||
std::function<void()> on_click;
|
||||
private:
|
||||
void scale_sprite_to_button_size();
|
||||
float get_button_height();
|
||||
private:
|
||||
mgl::vec2f size;
|
||||
mgl::Color bg_color;
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace gsr {
|
||||
void add_item(const std::string &text, const std::string &id, const std::string &description = "");
|
||||
void set_item_label(const std::string &id, const std::string &new_label);
|
||||
void set_item_icon(const std::string &id, mgl::Texture *texture);
|
||||
void set_item_description(const std::string &id, const std::string &new_description);
|
||||
|
||||
void set_description(std::string description_text);
|
||||
void set_activated(bool activated);
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace gsr {
|
||||
RECORD_START_STOP,
|
||||
RECORD_PAUSE_UNPAUSE,
|
||||
STREAM_START_STOP,
|
||||
TAKE_SCREENSHOT,
|
||||
SHOW_HIDE
|
||||
};
|
||||
|
||||
@@ -44,6 +45,7 @@ namespace gsr {
|
||||
std::function<void(const char *reason)> on_click_exit_program_button;
|
||||
std::function<void(const char *hotkey_option)> on_keyboard_hotkey_changed;
|
||||
std::function<void(const char *hotkey_option)> on_joystick_hotkey_changed;
|
||||
std::function<void()> on_page_closed;
|
||||
private:
|
||||
void load_hotkeys();
|
||||
|
||||
@@ -55,6 +57,7 @@ namespace gsr {
|
||||
std::unique_ptr<List> create_replay_hotkey_options();
|
||||
std::unique_ptr<List> create_record_hotkey_options();
|
||||
std::unique_ptr<List> create_stream_hotkey_options();
|
||||
std::unique_ptr<List> create_screenshot_hotkey_options();
|
||||
std::unique_ptr<List> create_hotkey_control_buttons();
|
||||
std::unique_ptr<Subsection> create_hotkey_subsection(ScrollablePage *parent_page);
|
||||
std::unique_ptr<Button> create_exit_program_button();
|
||||
@@ -86,6 +89,7 @@ namespace gsr {
|
||||
Button *start_stop_recording_button_ptr = nullptr;
|
||||
Button *pause_unpause_recording_button_ptr = nullptr;
|
||||
Button *start_stop_streaming_button_ptr = nullptr;
|
||||
Button *take_screenshot_button_ptr = nullptr;
|
||||
Button *show_hide_button_ptr = nullptr;
|
||||
|
||||
ConfigHotkey configure_config_hotkey;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
namespace gsr {
|
||||
class GsrPage : public Page {
|
||||
public:
|
||||
GsrPage();
|
||||
GsrPage(const char *top_text, const char *bottom_text);
|
||||
GsrPage(const GsrPage&) = delete;
|
||||
GsrPage& operator=(const GsrPage&) = delete;
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace gsr {
|
||||
float margin_bottom_scale = 0.0f;
|
||||
float margin_left_scale = 0.0f;
|
||||
float margin_right_scale = 0.0f;
|
||||
mgl::Text label_text;
|
||||
mgl::Text top_text;
|
||||
mgl::Text bottom_text;
|
||||
std::vector<ButtonItem> buttons;
|
||||
};
|
||||
}
|
||||
78
include/gui/ScreenshotSettingsPage.hpp
Normal file
78
include/gui/ScreenshotSettingsPage.hpp
Normal file
@@ -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<ComboBox> create_record_area_box();
|
||||
std::unique_ptr<Widget> create_record_area();
|
||||
std::unique_ptr<List> create_select_window();
|
||||
std::unique_ptr<Entry> create_image_width_entry();
|
||||
std::unique_ptr<Entry> create_image_height_entry();
|
||||
std::unique_ptr<List> create_image_resolution();
|
||||
std::unique_ptr<List> create_image_resolution_section();
|
||||
std::unique_ptr<CheckBox> create_restore_portal_session_checkbox();
|
||||
std::unique_ptr<List> create_restore_portal_session_section();
|
||||
std::unique_ptr<Widget> create_change_image_resolution_section();
|
||||
std::unique_ptr<Widget> create_capture_target_section();
|
||||
std::unique_ptr<List> create_image_quality_section();
|
||||
std::unique_ptr<Widget> create_record_cursor_section();
|
||||
std::unique_ptr<Widget> create_image_section();
|
||||
std::unique_ptr<List> create_save_directory(const char *label);
|
||||
std::unique_ptr<ComboBox> create_image_format_box();
|
||||
std::unique_ptr<List> create_image_format_section();
|
||||
std::unique_ptr<Widget> create_file_info_section();
|
||||
std::unique_ptr<CheckBox> create_save_screenshot_in_game_folder();
|
||||
std::unique_ptr<Widget> create_general_section();
|
||||
std::unique_ptr<Widget> create_notifications_section();
|
||||
std::unique_ptr<Widget> 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;
|
||||
};
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace gsr {
|
||||
std::unique_ptr<CheckBox> create_restore_portal_session_checkbox();
|
||||
std::unique_ptr<List> create_restore_portal_session_section();
|
||||
std::unique_ptr<Widget> create_change_video_resolution_section();
|
||||
std::unique_ptr<Widget> create_capture_target();
|
||||
std::unique_ptr<Widget> create_capture_target_section();
|
||||
std::unique_ptr<ComboBox> create_audio_device_selection_combobox();
|
||||
std::unique_ptr<Button> create_remove_audio_device_button(List *audio_device_list_ptr);
|
||||
std::unique_ptr<List> create_audio_device();
|
||||
|
||||
Reference in New Issue
Block a user