mirror of
https://github.com/ocornut/imgui.git
synced 2024-12-13 12:59:02 +08:00
CloseButton, CollapseButton: don't include FramePadding into size. Use ItemInnerSpacing.x between title bar buttons. Amend for Docking. (#6749)
This commit is contained in:
parent
676497fe05
commit
61d35972e2
11
imgui.cpp
11
imgui.cpp
@ -17050,14 +17050,13 @@ static void ImGui::DockNodeCalcTabBarLayout(const ImGuiDockNode* node, ImRect* o
|
||||
r.Max.x -= style.WindowBorderSize;
|
||||
|
||||
float button_sz = g.FontSize;
|
||||
|
||||
ImVec2 window_menu_button_pos = r.Min;
|
||||
r.Min.x += style.FramePadding.x;
|
||||
r.Max.x -= style.FramePadding.x;
|
||||
ImVec2 window_menu_button_pos = ImVec2(r.Min.x, r.Min.y + style.FramePadding.y);
|
||||
if (node->HasCloseButton)
|
||||
{
|
||||
r.Max.x -= button_sz;
|
||||
if (out_close_button_pos) *out_close_button_pos = ImVec2(r.Max.x - style.FramePadding.x, r.Min.y);
|
||||
if (out_close_button_pos) *out_close_button_pos = ImVec2(r.Max.x - button_sz, r.Min.y + style.FramePadding.y);
|
||||
r.Max.x -= button_sz + style.ItemInnerSpacing.x;
|
||||
}
|
||||
if (node->HasWindowMenuButton && style.WindowMenuButtonPosition == ImGuiDir_Left)
|
||||
{
|
||||
@ -17065,8 +17064,8 @@ static void ImGui::DockNodeCalcTabBarLayout(const ImGuiDockNode* node, ImRect* o
|
||||
}
|
||||
else if (node->HasWindowMenuButton && style.WindowMenuButtonPosition == ImGuiDir_Right)
|
||||
{
|
||||
r.Max.x -= button_sz + style.FramePadding.x;
|
||||
window_menu_button_pos = ImVec2(r.Max.x, r.Min.y);
|
||||
window_menu_button_pos = ImVec2(r.Max.x - button_sz, r.Min.y + style.FramePadding.y);
|
||||
r.Max.x -= button_sz + style.ItemInnerSpacing.x;
|
||||
}
|
||||
if (out_tab_bar_rect) { *out_tab_bar_rect = r; }
|
||||
if (out_window_menu_button_pos) { *out_window_menu_button_pos = window_menu_button_pos; }
|
||||
|
Loading…
Reference in New Issue
Block a user