MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / ArrowButtonEx

Method ArrowButtonEx

include/imgui/imgui_widgets.cpp:868–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

866}
867
868bool 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
896bool ImGui::ArrowButton(const char* str_id, ImGuiDir dir)
897{

Callers

nothing calls this directly

Calls 5

GetCurrentWindowFunction · 0.85
ItemSizeFunction · 0.85
ImVec2Function · 0.85
ImMaxFunction · 0.85
GetIDMethod · 0.80

Tested by

no test coverage detected