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.
| 17115 | // Special button that doesn't take focus, doesn't take input owner, and can be activated without a click etc. |
| 17116 | // In order to reduce interferences with the contents we are trying to debug into. |
| 17117 | bool ImGui::DebugBreakButton(const char* label, const char* description_of_location) |
| 17118 | { |
| 17119 | ImGuiWindow* window = GetCurrentWindow(); |
| 17120 | if (window->SkipItems) |
| 17121 | return false; |
| 17122 | |
| 17123 | ImGuiContext& g = *GImGui; |
| 17124 | const ImGuiID id = window->GetID(label); |
| 17125 | const ImVec2 label_size = CalcTextSize(label, NULL, true); |
| 17126 | ImVec2 pos = window->DC.CursorPos + ImVec2(0.0f, window->DC.CurrLineTextBaseOffset); |
| 17127 | ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x * 2.0f, label_size.y); |
| 17128 | |
| 17129 | const ImRect bb(pos, pos + size); |
| 17130 | ItemSize(size, 0.0f); |
| 17131 | if (!ItemAdd(bb, id)) |
| 17132 | return false; |
| 17133 | |
| 17134 | // WE DO NOT USE ButtonEx() or ButtonBehavior() in order to reduce our side-effects. |
| 17135 | bool hovered = ItemHoverable(bb, id, g.CurrentItemFlags); |
| 17136 | bool pressed = hovered && (IsKeyChordPressed(g.DebugBreakKeyChord) || IsMouseClicked(0) || g.NavActivateId == id); |
| 17137 | DebugBreakButtonTooltip(false, description_of_location); |
| 17138 | |
| 17139 | ImVec4 col4f = GetStyleColorVec4(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); |
| 17140 | ImVec4 hsv; |
| 17141 | ColorConvertRGBtoHSV(col4f.x, col4f.y, col4f.z, hsv.x, hsv.y, hsv.z); |
| 17142 | ColorConvertHSVtoRGB(hsv.x + 0.20f, hsv.y, hsv.z, col4f.x, col4f.y, col4f.z); |
| 17143 | |
| 17144 | RenderNavCursor(bb, id); |
| 17145 | RenderFrame(bb.Min, bb.Max, GetColorU32(col4f), true, g.Style.FrameRounding); |
| 17146 | RenderTextClipped(bb.Min, bb.Max, label, NULL, &label_size, g.Style.ButtonTextAlign, &bb); |
| 17147 | |
| 17148 | IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); |
| 17149 | return pressed; |
| 17150 | } |
| 17151 | |
| 17152 | // [DEBUG] Display contents of Columns |
| 17153 | void ImGui::DebugNodeColumns(ImGuiOldColumns* columns) |
nothing calls this directly
no test coverage detected