mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 13:35:49 +02:00
CloseButton, CollapseButton: don't include FramePadding into size. Use ItemInnerSpacing.x between title bar buttons. (#6749)
This commit is contained in:
12
imgui.cpp
12
imgui.cpp
@ -6095,18 +6095,18 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
|
||||
ImVec2 collapse_button_pos;
|
||||
if (has_close_button)
|
||||
{
|
||||
pad_r += button_sz;
|
||||
close_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - style.FramePadding.x, title_bar_rect.Min.y);
|
||||
close_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - button_sz, title_bar_rect.Min.y + style.FramePadding.y);
|
||||
pad_r += button_sz + style.ItemInnerSpacing.x;
|
||||
}
|
||||
if (has_collapse_button && style.WindowMenuButtonPosition == ImGuiDir_Right)
|
||||
{
|
||||
pad_r += button_sz;
|
||||
collapse_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - style.FramePadding.x, title_bar_rect.Min.y);
|
||||
collapse_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - button_sz, title_bar_rect.Min.y + style.FramePadding.y);
|
||||
pad_r += button_sz + style.ItemInnerSpacing.x;
|
||||
}
|
||||
if (has_collapse_button && style.WindowMenuButtonPosition == ImGuiDir_Left)
|
||||
{
|
||||
collapse_button_pos = ImVec2(title_bar_rect.Min.x + pad_l - style.FramePadding.x, title_bar_rect.Min.y);
|
||||
pad_l += button_sz;
|
||||
collapse_button_pos = ImVec2(title_bar_rect.Min.x + pad_l, title_bar_rect.Min.y + style.FramePadding.y);
|
||||
pad_l += button_sz + style.ItemInnerSpacing.x;
|
||||
}
|
||||
|
||||
// Collapse button (submitting first so it gets priority when choosing a navigation init fallback)
|
||||
|
Reference in New Issue
Block a user