| 18736 | } |
| 18737 | |
| 18738 | static void ImGui::DockNodeMoveWindows(ImGuiDockNode* dst_node, ImGuiDockNode* src_node) |
| 18739 | { |
| 18740 | // Insert tabs in the same orders as currently ordered (node->Windows isn't ordered) |
| 18741 | IM_ASSERT(src_node && dst_node && dst_node != src_node); |
| 18742 | ImGuiTabBar* src_tab_bar = src_node->TabBar; |
| 18743 | if (src_tab_bar != NULL) |
| 18744 | IM_ASSERT(src_node->Windows.Size <= src_node->TabBar->Tabs.Size); |
| 18745 | |
| 18746 | // If the dst_node is empty we can just move the entire tab bar (to preserve selection, scrolling, etc.) |
| 18747 | bool move_tab_bar = (src_tab_bar != NULL) && (dst_node->TabBar == NULL); |
| 18748 | if (move_tab_bar) |
| 18749 | { |
| 18750 | dst_node->TabBar = src_node->TabBar; |
| 18751 | src_node->TabBar = NULL; |
| 18752 | } |
| 18753 | |
| 18754 | // Tab order is not important here, it is preserved by sorting in DockNodeUpdateTabBar(). |
| 18755 | for (ImGuiWindow* window : src_node->Windows) |
| 18756 | { |
| 18757 | window->DockNode = NULL; |
| 18758 | window->DockIsActive = false; |
| 18759 | DockNodeAddWindow(dst_node, window, !move_tab_bar); |
| 18760 | } |
| 18761 | src_node->Windows.clear(); |
| 18762 | |
| 18763 | if (!move_tab_bar && src_node->TabBar) |
| 18764 | { |
| 18765 | if (dst_node->TabBar) |
| 18766 | dst_node->TabBar->SelectedTabId = src_node->TabBar->SelectedTabId; |
| 18767 | DockNodeRemoveTabBar(src_node); |
| 18768 | } |
| 18769 | } |
| 18770 | |
| 18771 | static void ImGui::DockNodeApplyPosSizeToWindows(ImGuiDockNode* node) |
| 18772 | { |