#include "../../include/gui/GlobalSettingsPage.hpp" #include "../../include/Theme.hpp" #include "../../include/gui/GsrPage.hpp" #include "../../include/gui/PageStack.hpp" #include "../../include/gui/ScrollablePage.hpp" #include "../../include/gui/Subsection.hpp" #include "../../include/gui/List.hpp" #include "../../include/gui/Label.hpp" #include "../../include/gui/RadioButton.hpp" namespace gsr { static const char* gpu_vendor_to_color_name(GpuVendor vendor) { switch(vendor) { case GpuVendor::UNKNOWN: return "amd"; case GpuVendor::AMD: return "amd"; case GpuVendor::INTEL: return "intel"; case GpuVendor::NVIDIA: return "nvidia"; } return "amd"; } GlobalSettingsPage::GlobalSettingsPage(const GsrInfo *gsr_info, Config &config, PageStack *page_stack) : StaticPage(mgl::vec2f(get_theme().window_width, get_theme().window_height).floor()), config(config), gsr_info(gsr_info), page_stack(page_stack) { auto content_page = std::make_unique(); content_page->add_button("Back", "back", get_color_theme().page_bg_color); content_page->on_click = [page_stack](const std::string &id) { if(id == "back") page_stack->pop(); }; content_page_ptr = content_page.get(); add_widget(std::move(content_page)); add_widgets(); load(); } std::unique_ptr GlobalSettingsPage::create_appearance_subsection(ScrollablePage *parent_page) { auto list = std::make_unique(List::Orientation::VERTICAL); list->add_widget(std::make_unique