Docking: Tweaked tooltip on tabs so they don't show immediately when holding and releasing a tab (using HoveredIdNotActiveTimer) + Minor refactor + Removed legacy .ini parsing.

This commit is contained in:
omar
2018-10-25 17:32:11 +02:00
parent c547b2e8ee
commit 1a6eea012d
2 changed files with 23 additions and 23 deletions

View File

@ -6489,10 +6489,10 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
}
#if 0
if (hovered && g.HoveredIdTimer > 0.40f && bb.GetWidth() < tab->WidthContents)
if (hovered && g.HoveredIdNotActiveTimer > 0.50f && bb.GetWidth() < tab->WidthContents)
{
// Enlarge tab display when hovering
bb.Max.x = bb.Min.x + (float)(int)ImLerp(bb.GetWidth(), tab->WidthContents, ImSaturate((g.HoveredIdTimer - 0.40f) * 6.0f));
bb.Max.x = bb.Min.x + (float)(int)ImLerp(bb.GetWidth(), tab->WidthContents, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f));
display_draw_list = GetOverlayDrawList(window);
TabItemRenderBackground(display_draw_list, bb, flags, GetColorU32(ImGuiCol_TitleBgActive));
}
@ -6527,7 +6527,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
window->DC.CursorPos = backup_main_cursor_pos;
// Tooltip (FIXME: Won't work over the close button because ItemOverlap systems messes up with HoveredIdTimer)
if (g.HoveredId == id && !held && g.HoveredIdTimer > 0.50f)
if (g.HoveredId == id && !held && g.HoveredIdNotActiveTimer > 0.50f)
SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
return tab_contents_visible;