Просмотр исходного кода

Fixed an issue where editor window non-client areas were not properly set up right after creation

Marko Pintera 10 лет назад
Родитель
Сommit
7f224d0279

+ 1 - 0
BansheeEditor/Include/BsEditorWidgetContainer.h

@@ -32,6 +32,7 @@ namespace BansheeEngine
 
 		void _notifyWidgetDestroyed(EditorWidgetBase* widget);
 
+		Event<void()> onWidgetAdded;
 		Event<void()> onWidgetClosed;
 	private:
 		EditorWindowBase* mParentWindow;

+ 1 - 0
BansheeEditor/Include/BsEditorWindow.h

@@ -25,6 +25,7 @@ namespace BansheeEngine
 		EditorWidgetContainer* mWidgets;
 
 		void updateSize();
+		void widgetAdded();
 		void widgetRemoved();
 		void closeWindowDelayed();
 	};

+ 2 - 0
BansheeEditor/Source/BsEditorWidgetContainer.cpp

@@ -108,6 +108,8 @@ namespace BansheeEngine
 			setActiveWidget(mTitleBar->getTabIdx(mTitleBar->getNumTabs() - 1));
 		else
 			widget._disable();
+
+		onWidgetAdded();
 	}
 
 	bool EditorWidgetContainer::contains(EditorWidgetBase& widget)

+ 6 - 0
BansheeEditor/Source/BsEditorWindow.cpp

@@ -11,6 +11,7 @@ namespace BansheeEngine
 	{
 		updateSize();
 		
+		mWidgets->onWidgetAdded.connect(std::bind(&EditorWindow::widgetAdded, this));
 		mWidgets->onWidgetClosed.connect(std::bind(&EditorWindow::widgetRemoved, this));
 	}
 
@@ -43,6 +44,11 @@ namespace BansheeEngine
 		Platform::setCaptionNonClientAreas(*mRenderWindow->getCore().get(), mWidgets->getDraggableAreas());
 	}
 
+	void EditorWindow::widgetAdded()
+	{
+		Platform::setCaptionNonClientAreas(*mRenderWindow->getCore().get(), mWidgets->getDraggableAreas());
+	}
+
 	void EditorWindow::widgetRemoved()
 	{
 		if(mWidgets->getNumWidgets() == 0)

+ 1 - 1
TODO.txt

@@ -67,7 +67,7 @@ Click on empty part of the menu bar doesn't close the menu bar (ignoring NC area
 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
 Attempting to dock a window that is not in focus will start drag instead (NC area incorrectly set up?)
-Dropping an element in "None" dock area closes the window
+Docking a window to another windows title bar doesn't seem to work
 Decent looking default layout
 Fix DX11 (and possibly DX9) rendering
 Missing Inspector values (name + transform fields)