| 17858 | } |
| 17859 | |
| 17860 | static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags) |
| 17861 | { |
| 17862 | ImGuiContext& g = *GImGui; |
| 17863 | ImVec2 size(ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x + ImGui::CalcTextSize(name).x, ImGui::GetFrameHeight()); |
| 17864 | SameLineOrWrap(size); // FIXME-LAYOUT: To be done automatically once we rework ItemSize/ItemAdd into ItemLayout. |
| 17865 | |
| 17866 | bool highlight_errors = (flags == ImGuiDebugLogFlags_EventError && g.DebugLogSkippedErrors > 0); |
| 17867 | if (highlight_errors) |
| 17868 | ImGui::PushStyleColor(ImGuiCol_Text, ImLerp(g.Style.Colors[ImGuiCol_Text], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.30f)); |
| 17869 | if (ImGui::CheckboxFlags(name, &g.DebugLogFlags, flags) && g.IO.KeyShift && (g.DebugLogFlags & flags) != 0) |
| 17870 | { |
| 17871 | g.DebugLogAutoDisableFrames = 2; |
| 17872 | g.DebugLogAutoDisableFlags |= flags; |
| 17873 | } |
| 17874 | if (highlight_errors) |
| 17875 | { |
| 17876 | ImGui::PopStyleColor(); |
| 17877 | ImGui::SetItemTooltip("%d past errors skipped.", g.DebugLogSkippedErrors); |
| 17878 | } |
| 17879 | else |
| 17880 | { |
| 17881 | ImGui::SetItemTooltip("Hold Shift when clicking to enable for 2 frames only (useful for spammy log entries)"); |
| 17882 | } |
| 17883 | } |
| 17884 | |
| 17885 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 17886 | { |
no test coverage detected