MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / BeginErrorTooltip

Method BeginErrorTooltip

imgui_tiny_app/imgui/imgui.cpp:11869–11891  ·  view source on GitHub ↗

Pseudo-tooltip. Follow mouse until Ctrl is held. When Ctrl is held we lock position, allowing to click it.

Source from the content-addressed store, hash-verified

11867
11868// Pseudo-tooltip. Follow mouse until Ctrl is held. When Ctrl is held we lock position, allowing to click it.
11869bool 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
11893void ImGui::EndErrorTooltip()
11894{

Callers

nothing calls this directly

Calls 3

ImLerpFunction · 0.85
ImVec4Class · 0.85
PopStyleColorFunction · 0.85

Tested by

no test coverage detected