Special button that doesn't take focus, doesn't take input owner, and can be activated without a click etc. In order to reduce interferences with the contents we are trying to debug into.
| 17206 | // Special button that doesn't take focus, doesn't take input owner, and can be activated without a click etc. |
| 17207 | // In order to reduce interferences with the contents we are trying to debug into. |
| 17208 | bool ImGui::DebugBreakButton(const char* label, const char* description_of_location) |
| 17209 | { |
| 17210 | ImGuiWindow* window = GetCurrentWindow(); |
| 17211 | if (window->SkipItems) |
| 17212 | return false; |
| 17213 | |
| 17214 | ImGuiContext& g = *GImGui; |
| 17215 | const ImGuiID id = window->GetID(label); |
| 17216 | const ImVec2 label_size = CalcTextSize(label, NULL, true); |
| 17217 | ImVec2 pos = window->DC.CursorPos + ImVec2(0.0f, window->DC.CurrLineTextBaseOffset); |
| 17218 | ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x * 2.0f, label_size.y); |
| 17219 | |
| 17220 | const ImRect bb(pos, pos + size); |
| 17221 | ItemSize(size, 0.0f); |
| 17222 | if (!ItemAdd(bb, id)) |
| 17223 | return false; |
| 17224 | |
| 17225 | // WE DO NOT USE ButtonEx() or ButtonBehavior() in order to reduce our side-effects. |
| 17226 | bool hovered = ItemHoverable(bb, id, g.CurrentItemFlags); |
| 17227 | bool pressed = hovered && (IsKeyChordPressed(g.DebugBreakKeyChord) || IsMouseClicked(0) || g.NavActivateId == id); |
| 17228 | DebugBreakButtonTooltip(false, description_of_location); |
| 17229 | |
| 17230 | ImVec4 col4f = GetStyleColorVec4(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); |
| 17231 | ImVec4 hsv; |
| 17232 | ColorConvertRGBtoHSV(col4f.x, col4f.y, col4f.z, hsv.x, hsv.y, hsv.z); |
| 17233 | ColorConvertHSVtoRGB(hsv.x + 0.20f, hsv.y, hsv.z, col4f.x, col4f.y, col4f.z); |
| 17234 | |
| 17235 | RenderNavCursor(bb, id); |
| 17236 | RenderFrame(bb.Min, bb.Max, GetColorU32(col4f), true, g.Style.FrameRounding); |
| 17237 | RenderTextClipped(bb.Min, bb.Max, label, NULL, &label_size, g.Style.ButtonTextAlign, &bb); |
| 17238 | |
| 17239 | IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); |
| 17240 | return pressed; |
| 17241 | } |
| 17242 | |
| 17243 | // [DEBUG] Display contents of Columns |
| 17244 | void ImGui::DebugNodeColumns(ImGuiOldColumns* columns) |
nothing calls this directly
no test coverage detected