Tab Bar: Made it possible to append to an existing tab bar by calling BeginTabBar()/EndTabBar() again.

# Conflicts:
#	imgui_widgets.cpp
This commit is contained in:
ocornut
2020-10-14 18:34:33 +02:00
parent 042a3b01d2
commit bae2240eda
3 changed files with 23 additions and 12 deletions

View File

@ -1960,7 +1960,8 @@ struct ImGuiTabBar
int CurrFrameVisible;
int PrevFrameVisible;
ImRect BarRect;
float LastTabContentHeight; // Record the height of contents submitted below the tab bar
float CurrTabsContentsHeight;
float PrevTabsContentsHeight; // Record the height of contents submitted below the tab bar
float WidthAllTabs; // Actual width of all tabs (locked during layout)
float WidthAllTabsIdeal; // Ideal width if all tabs were visible and not clipped
float ScrollingAnim;
@ -1976,8 +1977,9 @@ struct ImGuiTabBar
bool WantLayout;
bool VisibleTabWasSubmitted;
bool TabsAddedNew; // Set to true when a new tab item or button has been added to the tab bar during last frame
short LastTabItemIdx; // Index of last BeginTabItem() tab for use by EndTabItem()
short LastTabItemIdx; // Index of last BeginTabItem() tab for use by EndTabItem()
ImVec2 FramePadding; // style.FramePadding locked at the time of BeginTabBar()
ImVec2 TabsContentsMin;
ImGuiTextBuffer TabsNames; // For non-docking tab bar we re-append names in a contiguous buffer.
ImGuiTabBar();