| 834 | } |
| 835 | |
| 836 | bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos) |
| 837 | { |
| 838 | ImGuiContext& g = *GImGui; |
| 839 | ImGuiWindow* window = g.CurrentWindow; |
| 840 | |
| 841 | ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize)); |
| 842 | bool is_clipped = !ItemAdd(bb, id); |
| 843 | bool hovered, held; |
| 844 | bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_None); |
| 845 | if (is_clipped) |
| 846 | return pressed; |
| 847 | |
| 848 | // Render |
| 849 | ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); |
| 850 | ImU32 text_col = GetColorU32(ImGuiCol_Text); |
| 851 | if (hovered || held) |
| 852 | window->DrawList->AddCircleFilled(bb.GetCenter() + ImVec2(0.0f, -0.5f), g.FontSize * 0.5f + 1.0f, bg_col); |
| 853 | RenderArrow(window->DrawList, bb.Min, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f); |
| 854 | |
| 855 | // Switch to moving the window after mouse is moved beyond the initial drag threshold |
| 856 | if (IsItemActive() && IsMouseDragging(0)) |
| 857 | StartMouseMovingWindow(window); |
| 858 | |
| 859 | return pressed; |
| 860 | } |
| 861 | |
| 862 | ImGuiID ImGui::GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis) |
| 863 | { |
nothing calls this directly
no test coverage detected