mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-17 21:56:36 +00:00
parent
b93040e600
commit
13df4668d1
11
imgui.cpp
11
imgui.cpp
@ -5871,6 +5871,17 @@ bool ImGui::TreeNode(const char* label)
|
||||
return TreeNodeBehavior(window->GetID(label), 0, label, NULL);
|
||||
}
|
||||
|
||||
float ImGui::GetTreeNodeToLabelSpacing(ImGuiTreeNodeFlags flags)
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
float off_from_start;
|
||||
if (flags & ImGuiTreeNodeFlags_Framed)
|
||||
off_from_start = g.FontSize + (g.Style.FramePadding.x * 3.0f) - ((float)(int)(g.CurrentWindow->WindowPadding.x*0.5f) - 1);
|
||||
else
|
||||
off_from_start = g.FontSize + (g.Style.FramePadding.x * 2.0f);
|
||||
return off_from_start;
|
||||
}
|
||||
|
||||
void ImGui::SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond)
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
|
1
imgui.h
1
imgui.h
@ -321,6 +321,7 @@ namespace ImGui
|
||||
IMGUI_API void TreePush(const void* ptr_id = NULL); // "
|
||||
IMGUI_API void TreePop();
|
||||
IMGUI_API void SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond = 0); // set next tree node/collapsing header to be opened.
|
||||
IMGUI_API float GetTreeNodeToLabelSpacing(ImGuiTreeNodeFlags flags = 0); // return horizontal distance between cursor and text label due to collapsing node. == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
|
||||
IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. user doesn't have to call TreePop().
|
||||
IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user