mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
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:
@ -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.
|
||||
|
Reference in New Issue
Block a user