[studio/modlib] Add ig::ChildStackItem

This commit is contained in:
Gary Talent 2024-03-14 23:32:05 -05:00
parent dade484d87
commit c6750d50fc
2 changed files with 15 additions and 1 deletions

View File

@ -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 {
};
}
}

View File

@ -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);
}