TabBar: Allow closing entire TabBar (possible docking only) when it contains user-appended buttons. (#5515)

In docking branch we mass-call TabBarCloseTab(). Amend b26f1530. Standardize Changelog entries.
This commit is contained in:
Rokas Kupstys
2022-08-01 16:39:38 +03:00
committed by ocornut
parent e99c4fc668
commit e926a664d5
2 changed files with 33 additions and 29 deletions

View File

@ -7743,7 +7743,9 @@ void ImGui::TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id)
// Called on manual closure attempt
void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
{
IM_ASSERT(!(tab->Flags & ImGuiTabItemFlags_Button));
if (tab->Flags & ImGuiTabItemFlags_Button)
return; // A button appended with TabItemButton().
if (!(tab->Flags & ImGuiTabItemFlags_UnsavedDocument))
{
// This will remove a frame of lag for selecting another tab on closure.