Docking: Removed seemingly unnecessary test in TabItemEx() for undocking tab leading to window move. Added ImGuiDockNode::IsFloatingNode() helper to clarify code intent in various places.

This commit is contained in:
omar
2019-07-22 10:54:17 -07:00
parent 9cda3035fd
commit 6f8d34768d
4 changed files with 8 additions and 8 deletions

View File

@ -6979,10 +6979,8 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
SetItemAllowOverlap();
// Drag and drop a single floating window node moves it
// FIXME-DOCK: In theory we shouldn't test for the ConfigDockingNodifySingleWindows flag here.
// When our single window node and OnlyNodeWithWindows are working properly we may remove this check here.
ImGuiDockNode* node = docked_window ? docked_window->DockNode : NULL;
const bool single_floating_window_node = node && node->IsRootNode() && !node->IsDockSpace() && node->Windows.Size == 1 && g.IO.ConfigDockingTabBarOnSingleWindows;
const bool single_floating_window_node = node && node->IsFloatingNode() && (node->Windows.Size == 1);
if (held && single_floating_window_node && IsMouseDragging(0, 0.0f))
{
// Move