Tab Bar: Requested ideal content size (for auto-fit) doesn't affect horizontal scrolling. Followup to afa01d8. (#3414)

+ minor Table rename
This commit is contained in:
ocornut
2021-01-14 15:56:23 +01:00
parent 6af92b05bf
commit 0ea4408fd4
2 changed files with 4 additions and 2 deletions

View File

@ -7241,7 +7241,8 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
// Actual layout in host window (we don't do it in BeginTabBar() so as not to waste an extra frame)
ImGuiWindow* window = g.CurrentWindow;
window->DC.CursorPos = tab_bar->BarRect.Min;
ItemSize(ImVec2(tab_bar->WidthAllTabsIdeal, tab_bar->BarRect.GetHeight()), tab_bar->FramePadding.y);
ItemSize(tab_bar->BarRect.GetSize(), tab_bar->FramePadding.y);
window->DC.IdealMaxPos.x = ImMax(window->DC.IdealMaxPos.x, tab_bar->BarRect.Min.x + tab_bar->WidthAllTabsIdeal);
}
// Dockables uses Name/ID in the global namespace. Non-dockable items use the ID stack.