From cfcee1a5d8e5068cdc5171b01beb9f9e6251e51e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Oct 2024 01:52:22 +0200 Subject: Add option to change video resolution --- src/gui/SettingsPage.cpp | 98 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 2 deletions(-) (limited to 'src/gui/SettingsPage.cpp') diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index fb2cc68..11571dc 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -111,6 +111,36 @@ namespace gsr { return area_size_list; } + std::unique_ptr SettingsPage::create_video_width_entry() { + auto video_width_entry = std::make_unique(&get_theme().body_font, "1920", get_theme().body_font.get_character_size() * 3); + video_width_entry->validate_handler = create_entry_validator_integer_in_range(1, 1 << 15); + video_width_entry_ptr = video_width_entry.get(); + return video_width_entry; + } + + std::unique_ptr SettingsPage::create_video_height_entry() { + auto video_height_entry = std::make_unique(&get_theme().body_font, "1080", get_theme().body_font.get_character_size() * 3); + video_height_entry->validate_handler = create_entry_validator_integer_in_range(1, 1 << 15); + video_height_entry_ptr = video_height_entry.get(); + return video_height_entry; + } + + std::unique_ptr SettingsPage::create_video_resolution() { + auto area_size_params_list = std::make_unique(List::Orientation::HORIZONTAL, List::Alignment::CENTER); + area_size_params_list->add_widget(create_video_width_entry()); + area_size_params_list->add_widget(std::make_unique