mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user