mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-23 04:17:00 +00:00
Child window with MenuBar use regular WindowPadding.y so layout look consistent in child or in a regular window.
This commit is contained in:
parent
41862b8c0e
commit
2ab27be3de
@ -4251,7 +4251,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lock window padding so that altering the ShowBorders flag for children doesn't have side-effects.
|
// Lock window padding so that altering the ShowBorders flag for children doesn't have side-effects.
|
||||||
window->WindowPadding = ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_ComboBox | ImGuiWindowFlags_Popup))) ? ImVec2(0,0) : style.WindowPadding;
|
window->WindowPadding = style.WindowPadding;
|
||||||
|
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_ComboBox | ImGuiWindowFlags_Popup)))
|
||||||
|
window->WindowPadding = ImVec2(0.0f, (flags & ImGuiWindowFlags_MenuBar) ? style.WindowPadding.y : 0.0f);
|
||||||
|
|
||||||
// Calculate auto-fit size, handle automatic resize
|
// Calculate auto-fit size, handle automatic resize
|
||||||
const ImVec2 size_auto_fit = CalcSizeAutoFit(window);
|
const ImVec2 size_auto_fit = CalcSizeAutoFit(window);
|
||||||
|
Loading…
Reference in New Issue
Block a user