| 866 | } |
| 867 | |
| 868 | bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiButtonFlags flags) |
| 869 | { |
| 870 | ImGuiContext& g = *GImGui; |
| 871 | ImGuiWindow* window = GetCurrentWindow(); |
| 872 | if (window->SkipItems) |
| 873 | return false; |
| 874 | |
| 875 | const ImGuiID id = window->GetID(str_id); |
| 876 | const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); |
| 877 | const float default_size = GetFrameHeight(); |
| 878 | ItemSize(size, (size.y >= default_size) ? g.Style.FramePadding.y : -1.0f); |
| 879 | if (!ItemAdd(bb, id)) |
| 880 | return false; |
| 881 | |
| 882 | bool hovered, held; |
| 883 | bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); |
| 884 | |
| 885 | // Render |
| 886 | const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); |
| 887 | const ImU32 text_col = GetColorU32(ImGuiCol_Text); |
| 888 | RenderNavCursor(bb, id); |
| 889 | RenderFrame(bb.Min, bb.Max, bg_col, true, g.Style.FrameRounding); |
| 890 | RenderArrow(window->DrawList, bb.Min + ImVec2(ImMax(0.0f, (size.x - g.FontSize) * 0.5f), ImMax(0.0f, (size.y - g.FontSize) * 0.5f)), text_col, dir); |
| 891 | |
| 892 | IMGUI_TEST_ENGINE_ITEM_INFO(id, str_id, g.LastItemData.StatusFlags); |
| 893 | return pressed; |
| 894 | } |
| 895 | |
| 896 | bool ImGui::ArrowButton(const char* str_id, ImGuiDir dir) |
| 897 | { |
nothing calls this directly
no test coverage detected