Merge branch 'master' into navigation

docking
omar 7 years ago
commit f24b5f71ca

@ -4136,7 +4136,7 @@ static ImRect GetVisibleRect()
} }
// Not exposed publicly as BeginTooltip() because bool parameters are evil. Let's see if other needs arise first. // Not exposed publicly as BeginTooltip() because bool parameters are evil. Let's see if other needs arise first.
static void BeginTooltipEx(bool override_previous_tooltip) static void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip)
{ {
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
char window_name[16]; char window_name[16];
@ -4149,12 +4149,13 @@ static void BeginTooltipEx(bool override_previous_tooltip)
window->HiddenFrames = 1; window->HiddenFrames = 1;
ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip%02d", ++g.TooltipOverrideCount); ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip%02d", ++g.TooltipOverrideCount);
} }
ImGui::Begin(window_name, NULL, ImGuiWindowFlags_Tooltip|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoNavFocus); ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoNavFocus;
ImGui::Begin(window_name, NULL, flags | extra_flags);
} }
void ImGui::SetTooltipV(const char* fmt, va_list args) void ImGui::SetTooltipV(const char* fmt, va_list args)
{ {
BeginTooltipEx(true); BeginTooltipEx(0, true);
TextV(fmt, args); TextV(fmt, args);
EndTooltip(); EndTooltip();
} }
@ -4169,7 +4170,7 @@ void ImGui::SetTooltip(const char* fmt, ...)
void ImGui::BeginTooltip() void ImGui::BeginTooltip()
{ {
BeginTooltipEx(false); BeginTooltipEx(0, false);
} }
void ImGui::EndTooltip() void ImGui::EndTooltip()
@ -10069,7 +10070,7 @@ void ImGui::ColorTooltip(const char* text, const float col[4], ImGuiColorEditFla
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]); int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]);
BeginTooltipEx(true); BeginTooltipEx(0, true);
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)

Loading…
Cancel
Save