|
@@ -835,17 +835,15 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos)
|
|
|
return pressed;
|
|
|
|
|
|
// Render
|
|
|
- // FIXME: Clarify this mess
|
|
|
- ImU32 col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered);
|
|
|
- ImVec2 center = bb.GetCenter();
|
|
|
+ ImU32 bg_col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered);
|
|
|
if (hovered)
|
|
|
- window->DrawList->AddCircleFilled(center, ImMax(2.0f, g.FontSize * 0.5f + 1.0f), col);
|
|
|
-
|
|
|
- float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f;
|
|
|
+ window->DrawList->AddRectFilled(bb.Min, bb.Max, bg_col);
|
|
|
+ RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_Compact);
|
|
|
ImU32 cross_col = GetColorU32(ImGuiCol_Text);
|
|
|
- center -= ImVec2(0.5f, 0.5f);
|
|
|
- window->DrawList->AddLine(center + ImVec2(+cross_extent, +cross_extent), center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f);
|
|
|
- window->DrawList->AddLine(center + ImVec2(+cross_extent, -cross_extent), center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f);
|
|
|
+ ImVec2 cross_center = bb.GetCenter() - ImVec2(0.5f, 0.5f);
|
|
|
+ float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f;
|
|
|
+ window->DrawList->AddLine(cross_center + ImVec2(+cross_extent, +cross_extent), cross_center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f);
|
|
|
+ window->DrawList->AddLine(cross_center + ImVec2(+cross_extent, -cross_extent), cross_center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f);
|
|
|
|
|
|
return pressed;
|
|
|
}
|
|
@@ -866,7 +864,8 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
|
|
|
ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
|
|
|
ImU32 text_col = GetColorU32(ImGuiCol_Text);
|
|
|
if (hovered || held)
|
|
|
- window->DrawList->AddCircleFilled(bb.GetCenter() + ImVec2(0.0f, -0.5f), g.FontSize * 0.5f + 1.0f, bg_col);
|
|
|
+ window->DrawList->AddRectFilled(bb.Min, bb.Max, bg_col);
|
|
|
+ RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_Compact);
|
|
|
RenderArrow(window->DrawList, bb.Min, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f);
|
|
|
|
|
|
// Switch to moving the window after mouse is moved beyond the initial drag threshold
|