8#include <filedialog/filedialog.h>
9#include <imgui/imgui.h>
10#include <imgui/imgui_internal.h>
19 auto& settings = pm.get_editor_settings();
21 ImGui::PushItemWidth(150.0f);
23 if(
inspect(ctx, settings.external_tools).edit_finished)
25 pm.save_project_settings(ctx);
28 ImGui::PopItemWidth();
34 auto& settings = pm.get_editor_settings();
36 ImGui::PushItemWidth(150.0f);
38 if(
inspect(ctx, settings.debugger).edit_finished)
40 pm.save_project_settings(ctx);
43 ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f),
"%s",
"Requires an editor restart to apply changes.");
45 ImGui::PopItemWidth();
61 ImGui::OpenPopup(
name);
62 show_request_ =
false;
65 ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size * 0.5f);
67 if(ImGui::BeginPopupModal(
name, &
show))
79 auto avail = ImGui::GetContentRegionAvail();
80 if(avail.x < 1.0f || avail.y < 1.0f)
85 static std::vector<setting_entry> categories{{
"External Tools", &draw_external_tools_settings},
86 {
"Debugger", &draw_debugger_settings}};
89 ImGui::BeginChild(
"##LeftSidebar", avail * ImVec2(0.15f, 1.0f), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeX);
92 for(
const auto& category : categories)
95 if(ImGui::Selectable(category.id.c_str(), (selected_entry_.id == category.id)))
97 selected_entry_ = category;
107 ImGui::BeginChild(
"##RightContent");
109 if(selected_entry_.callback)
111 selected_entry_.callback(ctx);
editor_settings_panel(imgui_panels *parent)
void on_frame_ui_render(rtti::context &ctx, const char *name)
auto inspect(rtti::context &ctx, T &obj) -> inspect_result
Convenience template function for inspecting objects of known type.