Pseudo-tooltip. Follow mouse until Ctrl is held. When Ctrl is held we lock position, allowing to click it.
| 11867 | |
| 11868 | // Pseudo-tooltip. Follow mouse until Ctrl is held. When Ctrl is held we lock position, allowing to click it. |
| 11869 | bool ImGui::BeginErrorTooltip() |
| 11870 | { |
| 11871 | ImGuiContext& g = *GImGui; |
| 11872 | ImGuiWindow* window = FindWindowByName("##Tooltip_Error"); |
| 11873 | const bool use_locked_pos = (g.IO.KeyCtrl && window && window->WasActive); |
| 11874 | PushStyleColor(ImGuiCol_PopupBg, ImLerp(g.Style.Colors[ImGuiCol_PopupBg], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.15f)); |
| 11875 | if (use_locked_pos) |
| 11876 | SetNextWindowPos(g.ErrorTooltipLockedPos); |
| 11877 | bool is_visible = Begin("##Tooltip_Error", NULL, ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize); |
| 11878 | PopStyleColor(); |
| 11879 | if (is_visible && g.CurrentWindow->BeginCount == 1) |
| 11880 | { |
| 11881 | SeparatorText("MESSAGE FROM DEAR IMGUI"); |
| 11882 | BringWindowToDisplayFront(g.CurrentWindow); |
| 11883 | BringWindowToFocusFront(g.CurrentWindow); |
| 11884 | g.ErrorTooltipLockedPos = GetWindowPos(); |
| 11885 | } |
| 11886 | else if (!is_visible) |
| 11887 | { |
| 11888 | End(); |
| 11889 | } |
| 11890 | return is_visible; |
| 11891 | } |
| 11892 | |
| 11893 | void ImGui::EndErrorTooltip() |
| 11894 | { |
nothing calls this directly
no test coverage detected