mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-17 11:08:42 +01:00
Handle SameLine () with Separator ()
This commit is contained in:
parent
fbf45ad149
commit
7a6c25d95c
@ -1465,15 +1465,20 @@ void ImGui::Separator()
|
||||
if (window->SkipItems)
|
||||
return;
|
||||
|
||||
bool same_line = window->DC.IsSameLine;
|
||||
|
||||
// Those flags should eventually be configurable by the user
|
||||
// FIXME: We cannot g.Style.SeparatorTextBorderSize for thickness as it relates to SeparatorText() which is a decorated separator, not defaulting to 1.0f.
|
||||
ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal;
|
||||
ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal || same_line) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal;
|
||||
|
||||
// Only applies to legacy Columns() api as they relied on Separator() a lot.
|
||||
if (window->DC.CurrentColumns)
|
||||
flags |= ImGuiSeparatorFlags_SpanAllColumns;
|
||||
|
||||
SeparatorEx(flags, 1.0f);
|
||||
|
||||
if (same_line)
|
||||
SameLine ();
|
||||
}
|
||||
|
||||
void ImGui::SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_w)
|
||||
|
Loading…
x
Reference in New Issue
Block a user