TabBar: feed desired width (sum of unclipped tabs width) into layout system to allow for auto-resize. (#2768)

Before 1.71 tab bars fed the sum of current width which created feedback loops in certain situations. Amend f95c77eeea.
This commit is contained in:
omar
2019-08-29 14:46:02 +02:00
parent f8d3d8d7f5
commit 3f99890f40
4 changed files with 14 additions and 7 deletions

View File

@ -1435,8 +1435,9 @@ struct ImGuiTabBar
int CurrFrameVisible;
int PrevFrameVisible;
ImRect BarRect;
float ContentsHeight;
float LastTabContentHeight; // Record the height of contents submitted below the tab bar
float OffsetMax; // Distance from BarRect.Min.x, locked during layout
float OffsetMaxIdeal; // Ideal offset if all tabs were visible and not clipped
float OffsetNextTab; // Distance from BarRect.Min.x, incremented with each BeginTabItem() call, not used if ImGuiTabBarFlags_Reorderable if set.
float ScrollingAnim;
float ScrollingTarget;