| 768 | } |
| 769 | |
| 770 | bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiButtonFlags flags) |
| 771 | { |
| 772 | ImGuiContext& g = *GImGui; |
| 773 | ImGuiWindow* window = GetCurrentWindow(); |
| 774 | if (window->SkipItems) |
| 775 | return false; |
| 776 | |
| 777 | const ImGuiID id = window->GetID(str_id); |
| 778 | const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); |
| 779 | const float default_size = GetFrameHeight(); |
| 780 | ItemSize(size, (size.y >= default_size) ? g.Style.FramePadding.y : -1.0f); |
| 781 | if (!ItemAdd(bb, id)) |
| 782 | return false; |
| 783 | |
| 784 | if (g.LastItemData.InFlags & ImGuiItemFlags_ButtonRepeat) |
| 785 | flags |= ImGuiButtonFlags_Repeat; |
| 786 | |
| 787 | bool hovered, held; |
| 788 | bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); |
| 789 | |
| 790 | // Render |
| 791 | const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); |
| 792 | const ImU32 text_col = GetColorU32(ImGuiCol_Text); |
| 793 | RenderNavHighlight(bb, id); |
| 794 | RenderFrame(bb.Min, bb.Max, bg_col, true, g.Style.FrameRounding); |
| 795 | 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); |
| 796 | |
| 797 | IMGUI_TEST_ENGINE_ITEM_INFO(id, str_id, g.LastItemData.StatusFlags); |
| 798 | return pressed; |
| 799 | } |
| 800 | |
| 801 | bool ImGui::ArrowButton(const char* str_id, ImGuiDir dir) |
| 802 | { |
nothing calls this directly
no test coverage detected