From 07a64ffd954b4273bd6afc7fa03b284c3dced640 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 5 Nov 2024 00:17:03 +0100 Subject: Add replay ram usage estimation --- src/gui/Entry.cpp | 2 ++ src/gui/Label.cpp | 4 ++++ src/gui/SettingsPage.cpp | 40 +++++++++++++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/Entry.cpp b/src/gui/Entry.cpp index 4f318ec..9a3fccf 100644 --- a/src/gui/Entry.cpp +++ b/src/gui/Entry.cpp @@ -89,6 +89,8 @@ namespace gsr { if(!validate_handler || validate_handler(str)) { text.set_string(std::move(str)); caret_offset_x = text.find_character_pos(99999).x - this->text.get_position().x; + if(on_changed) + on_changed(text.get_string()); } } diff --git a/src/gui/Label.cpp b/src/gui/Label.cpp index 09fd1a6..22a302f 100644 --- a/src/gui/Label.cpp +++ b/src/gui/Label.cpp @@ -18,6 +18,10 @@ namespace gsr { window.draw(text); } + void Label::set_text(std::string str) { + text.set_string(std::move(str)); + } + mgl::vec2f Label::get_size() { if(!visible) return {0.0f, 0.0f}; diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index eb9523d..94c33fd 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -449,8 +449,11 @@ namespace gsr { (void)text; const bool custom_selected = id == "custom"; video_bitrate_list_ptr->set_visible(custom_selected); + + if(estimated_file_size_ptr) + estimated_file_size_ptr->set_visible(custom_selected); }; - video_quality_box_ptr->on_selection_changed("Very high", "very_high"); + video_quality_box_ptr->on_selection_changed("", video_quality_box_ptr->get_selected_id()); if(!gsr_info.supported_capture_options.monitors.empty()) record_area_box_ptr->set_selected_item(gsr_info.supported_capture_options.monitors.front().name); @@ -545,11 +548,30 @@ namespace gsr { return checkbox; } + std::unique_ptr