Skip to content

Commit

Permalink
Docking: Clicking on the right-most close button of a docking node cl…
Browse files Browse the repository at this point in the history
…oses all windows. (#4186)
  • Loading branch information
ocornut committed Jun 3, 2021
1 parent f03ab2a commit 5e528d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Other Changes:

Docking+Viewports Branch:

- Docking: Clicking on the right-most close button of a docking node closes all windows. (#4186)
- Docking: Fix IsWindowAppearing() and ImGuiCond_Appearing on docked windows. (#4177, #3982, #1497, #1061)


Expand Down
10 changes: 5 additions & 5 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14027,11 +14027,11 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_Text] * ImVec4(1.0f,1.0f,1.0f,0.4f));
}
if (CloseButton(host_window->GetID("#CLOSE"), close_button_pos))
if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_bar->VisibleTabId))
{
node->WantCloseTabId = tab->ID;
TabBarCloseTab(tab_bar, tab);
}
{
node->WantCloseAll = true;
for (int n = 0; n < tab_bar->Tabs.Size; n++)
TabBarCloseTab(tab_bar, &tab_bar->Tabs[n]);
}
//if (IsItemActive())
// focus_tab_id = tab_bar->SelectedTabId;
if (!close_button_is_enabled)
Expand Down

0 comments on commit 5e528d9

Please sign in to comment.