Fix for latest

This commit is contained in:
ocornut 2024-06-07 19:09:54 +02:00
parent 8ce47f82b4
commit 4bd4b41e73
2 changed files with 6 additions and 2 deletions

View File

@ -6418,8 +6418,8 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
#ifdef WIN98 // windows style title bar #ifdef WIN98 // windows style title bar
close_button_pos += ImVec2(0.0f, 2.0f); close_button_pos += ImVec2(-2.0f, -2.0f);
collapse_button_pos += ImVec2(0.0f, 2.0f); collapse_button_pos += ImVec2(-2.0f, -2.0f);
ImU32 col_left = IM_COL32(128,128,128,255); ImU32 col_left = IM_COL32(128,128,128,255);
ImU32 col_right = IM_COL32(181,181,181,255); ImU32 col_right = IM_COL32(181,181,181,255);

View File

@ -6640,6 +6640,10 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl
float button_size = g.FontSize; float button_size = g.FontSize;
float button_x = ImMax(g.LastItemData.Rect.Min.x, g.LastItemData.Rect.Max.x - g.Style.FramePadding.x - button_size); float button_x = ImMax(g.LastItemData.Rect.Min.x, g.LastItemData.Rect.Max.x - g.Style.FramePadding.x - button_size);
float button_y = g.LastItemData.Rect.Min.y + g.Style.FramePadding.y; float button_y = g.LastItemData.Rect.Min.y + g.Style.FramePadding.y;
#ifdef WIN98
button_x -= 4;
button_y -= 1;
#endif
ImGuiID close_button_id = GetIDWithSeed("#CLOSE", NULL, id); ImGuiID close_button_id = GetIDWithSeed("#CLOSE", NULL, id);
if (CloseButton(close_button_id, ImVec2(button_x, button_y))) if (CloseButton(close_button_id, ImVec2(button_x, button_y)))
*p_visible = false; *p_visible = false;