diff --git a/src/olympic/studio/modlib/include/studio/imguiutil.hpp b/src/olympic/studio/modlib/include/studio/imguiutil.hpp index 312ea0f4..aff6db87 100644 --- a/src/olympic/studio/modlib/include/studio/imguiutil.hpp +++ b/src/olympic/studio/modlib/include/studio/imguiutil.hpp @@ -15,6 +15,12 @@ namespace studio::ig { inline constexpr auto BtnSz = ImVec2{52, 22}; +class ChildStackItem { + public: + explicit ChildStackItem(ox::CStringView id, ImVec2 const&sz = {}) noexcept; + ~ChildStackItem() noexcept; +}; + class IDStackItem { public: explicit IDStackItem(int id) noexcept; @@ -98,4 +104,4 @@ class FilePicker { }; -} \ No newline at end of file +} diff --git a/src/olympic/studio/modlib/src/imguiutil.cpp b/src/olympic/studio/modlib/src/imguiutil.cpp index 5b1765c4..a90f7c2e 100644 --- a/src/olympic/studio/modlib/src/imguiutil.cpp +++ b/src/olympic/studio/modlib/src/imguiutil.cpp @@ -10,6 +10,14 @@ namespace studio::ig { +ChildStackItem::ChildStackItem(ox::CStringView id, ImVec2 const&sz) noexcept { + ImGui::BeginChild(id.c_str(), sz); +} + +ChildStackItem::~ChildStackItem() noexcept { + ImGui::EndChild(); +} + IDStackItem::IDStackItem(int id) noexcept { ImGui::PushID(id); }