1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-12-01 02:37:24 +01:00

Tooltips, Internal: (Breaking) swapped parameter order to accomodate for future tooltip api rework.

This commit is contained in:
ocornut 2021-11-10 17:53:58 +01:00
parent 7cd3cfa58a
commit f8a806ad9f
3 changed files with 6 additions and 6 deletions

View File

@ -8219,10 +8219,10 @@ void ImGui::SetScrollHereY(float center_y_ratio)
void ImGui::BeginTooltip() void ImGui::BeginTooltip()
{ {
BeginTooltipEx(ImGuiWindowFlags_None, ImGuiTooltipFlags_None); BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None);
} }
void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags) void ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags)
{ {
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
@ -8251,7 +8251,7 @@ void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags toolt
ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount); ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount);
} }
ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize; ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
Begin(window_name, NULL, flags | extra_flags); Begin(window_name, NULL, flags | extra_window_flags);
} }
void ImGui::EndTooltip() void ImGui::EndTooltip()
@ -8262,7 +8262,7 @@ void ImGui::EndTooltip()
void ImGui::SetTooltipV(const char* fmt, va_list args) void ImGui::SetTooltipV(const char* fmt, va_list args)
{ {
BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip); BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
TextV(fmt, args); TextV(fmt, args);
EndTooltip(); EndTooltip();
} }

View File

@ -2527,7 +2527,7 @@ namespace ImGui
IMGUI_API void ClosePopupsExceptModals(); IMGUI_API void ClosePopupsExceptModals();
IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags); IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags);
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags); IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags);
IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags); IMGUI_API void BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window); IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);
IMGUI_API ImGuiWindow* GetTopMostPopupModal(); IMGUI_API ImGuiWindow* GetTopMostPopupModal();
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window); IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);

View File

@ -5580,7 +5580,7 @@ void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags
{ {
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip); BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text; const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text;
if (text_end > text) if (text_end > text)
{ {