Преглед изворни кода

Fixed dock manager so it doesn't incorrectly dock to non-leaf elements

Marko Pintera пре 10 година
родитељ
комит
41ec58e730
2 измењених фајлова са 28 додато и 10 уклоњено
  1. 27 7
      BansheeEditor/Source/BsDockManager.cpp
  2. 1 3
      TODO.txt

+ 27 - 7
BansheeEditor/Source/BsDockManager.cpp

@@ -335,11 +335,21 @@ namespace BansheeEngine
 		}
 		}
 		else
 		else
 		{
 		{
-			if(mChildren[0] != nullptr && mChildren[0]->find(widgetContainer) != nullptr)
-				return mChildren[0];
+			if(mChildren[0] != nullptr)
+			{
+				DockContainer* foundContainer = mChildren[0]->find(widgetContainer);
+
+				if (foundContainer != nullptr)
+					return foundContainer;
+			}
 
 
 			if(mChildren[1] != nullptr && mChildren[1]->find(widgetContainer) != nullptr)
 			if(mChildren[1] != nullptr && mChildren[1]->find(widgetContainer) != nullptr)
-				return mChildren[1];
+			{
+				DockContainer* foundContainer = mChildren[1]->find(widgetContainer);
+
+				if (foundContainer != nullptr)
+					return foundContainer;
+			}
 		}
 		}
 
 
 		return nullptr;
 		return nullptr;
@@ -356,11 +366,21 @@ namespace BansheeEngine
 		}
 		}
 		else
 		else
 		{
 		{
-			if(mChildren[0] != nullptr && mChildren[0]->findAtPos(pos) != nullptr)
-				return mChildren[0];
+			if (mChildren[0] != nullptr)
+			{
+				DockContainer* foundContainer = mChildren[0]->findAtPos(pos);
+
+				if (foundContainer != nullptr)
+					return foundContainer;
+			}
 
 
-			if(mChildren[1] != nullptr && mChildren[1]->findAtPos(pos) != nullptr)
-				return mChildren[1];
+			if(mChildren[1] != nullptr)
+			{
+				DockContainer* foundContainer = mChildren[1]->findAtPos(pos);
+
+				if (foundContainer != nullptr)
+					return foundContainer;
+			}
 		}
 		}
 
 
 		return nullptr;
 		return nullptr;

+ 1 - 3
TODO.txt

@@ -66,15 +66,13 @@ When elements are docked in the main window the menu bar drop down appears behin
 Click on empty part of the menu bar doesn't close the menu bar (ignoring NC area clicks?)
 Click on empty part of the menu bar doesn't close the menu bar (ignoring NC area clicks?)
 Clicking on a parent of a menu item just reopens that item but I would expect it to close it
 Clicking on a parent of a menu item just reopens that item but I would expect it to close it
 Clicking on menu items doesn't seem to work
 Clicking on menu items doesn't seem to work
-GUI element that was deleted was part of a widget. This happened when I was docking windows and undocking them (scene, hierarchy, inspector)
 Attempting to dock a window that is not in focus will start drag instead (NC area incorrectly set up?)
 Attempting to dock a window that is not in focus will start drag instead (NC area incorrectly set up?)
-Docking problem: When I dock three windows next to each other, e.g. Hierarchy|Scene|Inspector and then try to dock another
- so it splits space with Hierarchy vertically the dock area appears over both hierarchy and scene, and the when docked it looks wrong
 Decent looking default layout
 Decent looking default layout
 Fix DX11 (and possibly DX9) rendering
 Fix DX11 (and possibly DX9) rendering
 Missing Inspector values (name + transform fields)
 Missing Inspector values (name + transform fields)
 Fix handles
 Fix handles
 Moving the title bar tab and then dropping it closes the window (possibly only happens when there is just one tab)
 Moving the title bar tab and then dropping it closes the window (possibly only happens when there is just one tab)
+After undocking ProjectWindow the auto-scroll seems to be stuck in up position
 
 
 Need a way to add scene objects and components (and remove them)
 Need a way to add scene objects and components (and remove them)