mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-26 02:34:23 +00:00
BeginChildFrame() / EndChildFrame() helpers.
This commit is contained in:
parent
1e9f6cce7f
commit
e7f51172c1
2 changed files with 20 additions and 0 deletions
17
imgui.cpp
17
imgui.cpp
|
|
@ -2530,6 +2530,23 @@ void ImGui::EndChild()
|
|||
}
|
||||
}
|
||||
|
||||
// Helper to create a child window / scrolling region that looks like a normal widget frame.
|
||||
void ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size)
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
const ImGuiStyle& style = g.Style;
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, style.Colors[ImGuiCol_FrameBg]);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, style.FrameRounding);
|
||||
ImGui::BeginChild(id, size);
|
||||
}
|
||||
|
||||
void ImGui::EndChildFrame()
|
||||
{
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleVar();
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
static ImGuiWindow* FindWindowByName(const char* name)
|
||||
{
|
||||
// FIXME-OPT: Consider optimizing this (e.g. sorted hashes to window pointers)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue