@ -6290,8 +6290,8 @@ ImGuiTabBar::ImGuiTabBar()
ID = 0 ;
SelectedTabId = NextSelectedTabId = VisibleTabId = 0 ;
CurrFrameVisible = PrevFrameVisible = - 1 ;
Contents Height = 0.0f ;
OffsetMax = Offset NextTab = 0.0f ;
LastTab ContentHeight = 0.0f ;
OffsetMax = Offset MaxIdeal = Offset NextTab = 0.0f ;
ScrollingAnim = ScrollingTarget = ScrollingTargetDistToVisibility = ScrollingSpeed = 0.0f ;
Flags = ImGuiTabBarFlags_None ;
ReorderRequestTabId = 0 ;
@ -6373,7 +6373,7 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG
tab_bar - > FramePadding = g . Style . FramePadding ;
// Layout
ItemSize ( ImVec2 ( 0.0f /*tab_bar->OffsetMax*/ , tab_bar - > BarRect . GetHeight ( ) ) ) ; // Don't feed width back
ItemSize ( ImVec2 ( tab_bar - > OffsetMaxIdeal , tab_bar - > BarRect . GetHeight ( ) ) ) ;
window - > DC . CursorPos . x = tab_bar - > BarRect . Min . x ;
// Draw separator
@ -6406,9 +6406,9 @@ void ImGui::EndTabBar()
// Restore the last visible height if no tab is visible, this reduce vertical flicker/movement when a tabs gets removed without calling SetTabItemClosed().
const bool tab_bar_appearing = ( tab_bar - > PrevFrameVisible + 1 < g . FrameCount ) ;
if ( tab_bar - > VisibleTabWasSubmitted | | tab_bar - > VisibleTabId = = 0 | | tab_bar_appearing )
tab_bar - > Contents Height = ImMax ( window - > DC . CursorPos . y - tab_bar - > BarRect . Max . y , 0.0f ) ;
tab_bar - > LastTab ContentHeight = ImMax ( window - > DC . CursorPos . y - tab_bar - > BarRect . Max . y , 0.0f ) ;
else
window - > DC . CursorPos . y = tab_bar - > BarRect . Max . y + tab_bar - > Contents Height;
window - > DC . CursorPos . y = tab_bar - > BarRect . Max . y + tab_bar - > LastTab ContentHeight;
if ( ( tab_bar - > Flags & ImGuiTabBarFlags_DockNode ) = = 0 )
PopID ( ) ;
@ -6532,6 +6532,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
// Layout all active tabs
float offset_x = initial_offset_x ;
float offset_x_ideal = offset_x ;
tab_bar - > OffsetNextTab = offset_x ; // This is used by non-reorderable tab bar where the submission order is always honored.
for ( int tab_n = 0 ; tab_n < tab_bar - > Tabs . Size ; tab_n + + )
{
@ -6540,8 +6541,10 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
if ( scroll_track_selected_tab_id = = 0 & & g . NavJustMovedToId = = tab - > ID )
scroll_track_selected_tab_id = tab - > ID ;
offset_x + = tab - > Width + g . Style . ItemInnerSpacing . x ;
offset_x_ideal + = tab - > WidthContents + g . Style . ItemInnerSpacing . x ;
}
tab_bar - > OffsetMax = ImMax ( offset_x - g . Style . ItemInnerSpacing . x , 0.0f ) ;
tab_bar - > OffsetMaxIdeal = ImMax ( offset_x_ideal - g . Style . ItemInnerSpacing . x , 0.0f ) ;
// Horizontal scrolling buttons
const bool scrolling_buttons = ( tab_bar - > OffsetMax > tab_bar - > BarRect . GetWidth ( ) & & tab_bar - > Tabs . Size > 1 ) & & ! ( tab_bar - > Flags & ImGuiTabBarFlags_NoTabListScrollingButtons ) & & ( tab_bar - > Flags & ImGuiTabBarFlags_FittingPolicyScroll ) ;