Bläddra i källkod

Improved inspector and menu bar look

Marko Pintera 10 år sedan
förälder
incheckning
ddf2e30ba6

+ 2 - 0
BansheeEditor/Include/BsGUIMenuBar.h

@@ -22,6 +22,7 @@ namespace BansheeEngine
 			WString name;
 			WString name;
 			GUIMenu* menu;
 			GUIMenu* menu;
 			GUIButton* button;
 			GUIButton* button;
+			GUIFixedSpace* space;
 		};
 		};
 
 
 	public:
 	public:
@@ -77,6 +78,7 @@ namespace BansheeEngine
 		void removeMenuItem(const WString& path);
 		void removeMenuItem(const WString& path);
 	private:
 	private:
 		static const UINT32 NUM_ELEMENTS_AFTER_CONTENT;
 		static const UINT32 NUM_ELEMENTS_AFTER_CONTENT;
+		static const UINT32 ELEMENT_SPACING;
 
 
 		RenderWindow* mParentWindow;
 		RenderWindow* mParentWindow;
 		GUIWidget* mParentWidget;
 		GUIWidget* mParentWidget;

+ 1 - 1
BansheeEditor/Source/BsGUIFoldout.cpp

@@ -122,7 +122,7 @@ namespace BansheeEngine
 		optimalsize.x += labelOptimalSize.x;
 		optimalsize.x += labelOptimalSize.x;
 		optimalsize.y = std::max(optimalsize.y, labelOptimalSize.y);
 		optimalsize.y = std::max(optimalsize.y, labelOptimalSize.y);
 
 
-		return optimalsize;
+		return mDimensions.calculateSizeRange(optimalsize).optimal;
 	}
 	}
 
 
 	void GUIFoldout::styleUpdated()
 	void GUIFoldout::styleUpdated()

+ 7 - 0
BansheeEditor/Source/BsGUIMenuBar.cpp

@@ -17,6 +17,7 @@
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	const UINT32 GUIMenuBar::NUM_ELEMENTS_AFTER_CONTENT = 8;
 	const UINT32 GUIMenuBar::NUM_ELEMENTS_AFTER_CONTENT = 8;
+	const UINT32 GUIMenuBar::ELEMENT_SPACING = 10;
 
 
 	GUIMenuBar::GUIMenuBar(GUIWidget* parent, RenderWindow* parentWindow)
 	GUIMenuBar::GUIMenuBar(GUIWidget* parent, RenderWindow* parentWindow)
 		:mParentWidget(parent), mParentWindow(parentWindow), mMainPanel(nullptr), mMainLayout(nullptr),
 		:mParentWidget(parent), mParentWindow(parentWindow), mMainPanel(nullptr), mMainLayout(nullptr),
@@ -69,6 +70,7 @@ namespace BansheeEngine
 		{
 		{
 			bs_delete(menu.menu);
 			bs_delete(menu.menu);
 			GUIElement::destroy(menu.button);
 			GUIElement::destroy(menu.button);
+			GUIFixedSpace::destroy(menu.space);
 		}
 		}
 
 
 		GUILayout::destroy(mMainPanel);
 		GUILayout::destroy(mMainPanel);
@@ -143,9 +145,12 @@ namespace BansheeEngine
 		GUIButton* newButton = GUIButton::create(HString(name), "MenuBarBtn");
 		GUIButton* newButton = GUIButton::create(HString(name), "MenuBarBtn");
 		newButton->onClick.connect(std::bind(&GUIMenuBar::openSubMenu, this, name));
 		newButton->onClick.connect(std::bind(&GUIMenuBar::openSubMenu, this, name));
 		newButton->onHover.connect(std::bind(&GUIMenuBar::onSubMenuHover, this, name));
 		newButton->onHover.connect(std::bind(&GUIMenuBar::onSubMenuHover, this, name));
+
+		GUIFixedSpace* space = mMainLayout->insertNewElement<GUIFixedSpace>(mMainLayout->getNumChildren() - NUM_ELEMENTS_AFTER_CONTENT, ELEMENT_SPACING);
 		mMainLayout->insertElement(mMainLayout->getNumChildren() - NUM_ELEMENTS_AFTER_CONTENT, newButton);
 		mMainLayout->insertElement(mMainLayout->getNumChildren() - NUM_ELEMENTS_AFTER_CONTENT, newButton);
 
 
 		newSubMenu.button = newButton;
 		newSubMenu.button = newButton;
+		newSubMenu.space = space;
 
 
 		return &newSubMenu;
 		return &newSubMenu;
 	}
 	}
@@ -192,7 +197,9 @@ namespace BansheeEngine
 				return;
 				return;
 
 
 			mMainLayout->removeElement(subMenuToRemove->button);
 			mMainLayout->removeElement(subMenuToRemove->button);
+			mMainLayout->removeElement(subMenuToRemove->space);
 			GUIElement::destroy(subMenuToRemove->button);
 			GUIElement::destroy(subMenuToRemove->button);
+			GUIFixedSpace::destroy(subMenuToRemove->space);
 			bs_delete(subMenuToRemove->menu);
 			bs_delete(subMenuToRemove->menu);
 
 
 			mChildMenus.erase(mChildMenus.begin() + curIdx);
 			mChildMenus.erase(mChildMenus.begin() + curIdx);

+ 11 - 9
MBansheeEditor/Inspector/InspectableArray.cs

@@ -38,10 +38,10 @@ namespace BansheeEditor
                     ownsTitleLayout = true;
                     ownsTitleLayout = true;
                 }
                 }
 
 
-                GUIButton cloneBtn = new GUIButton("C");
-                GUIButton deleteBtn = new GUIButton("X");
-                GUIButton moveUpBtn = new GUIButton("Up");
-                GUIButton moveDownBtn = new GUIButton("Down");
+                GUIButton cloneBtn = new GUIButton("C", GUIOption.FixedWidth(20));
+                GUIButton deleteBtn = new GUIButton("X", GUIOption.FixedWidth(20));
+                GUIButton moveUpBtn = new GUIButton("U", GUIOption.FixedWidth(20));
+                GUIButton moveDownBtn = new GUIButton("D", GUIOption.FixedWidth(20));
 
 
                 cloneBtn.OnClick += () => parent.OnCloneButtonClicked(seqIndex);
                 cloneBtn.OnClick += () => parent.OnCloneButtonClicked(seqIndex);
                 deleteBtn.OnClick += () => parent.OnDeleteButtonClicked(seqIndex);
                 deleteBtn.OnClick += () => parent.OnDeleteButtonClicked(seqIndex);
@@ -148,13 +148,14 @@ namespace BansheeEditor
                 guiChildLayout = null;
                 guiChildLayout = null;
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
 
 
-                guiTitleLayout.AddElement(new GUILabel(title));
+                guiTitleLayout.AddElement(new GUILabel(title, GUIOption.FixedWidth(100)));
                 guiTitleLayout.AddElement(new GUILabel("Empty"));
                 guiTitleLayout.AddElement(new GUILabel("Empty"));
 
 
                 if (!property.IsValueType)
                 if (!property.IsValueType)
                 {
                 {
-                    GUIButton createBtn = new GUIButton("Create");
+                    GUIButton createBtn = new GUIButton("Cr", GUIOption.FixedWidth(20));
                     createBtn.OnClick += OnCreateButtonClicked;
                     createBtn.OnClick += OnCreateButtonClicked;
+                    guiTitleLayout.AddFlexibleSpace();
                     guiTitleLayout.AddElement(createBtn);
                     guiTitleLayout.AddElement(createBtn);
                 }
                 }
 
 
@@ -162,19 +163,20 @@ namespace BansheeEditor
             }
             }
             else
             else
             {
             {
-                GUIFoldout guiFoldout = new GUIFoldout(title);
+                GUIFoldout guiFoldout = new GUIFoldout(title, GUIOption.FixedWidth(100));
                 guiFoldout.SetExpanded(isExpanded);
                 guiFoldout.SetExpanded(isExpanded);
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiSizeField = new GUIIntField();
                 guiSizeField = new GUIIntField();
                 guiSizeField.SetRange(0, int.MaxValue);
                 guiSizeField.SetRange(0, int.MaxValue);
-                GUIButton guiResizeBtn = new GUIButton("Resize");
+                GUIButton guiResizeBtn = new GUIButton("R", GUIOption.FixedWidth(20));
                 guiResizeBtn.OnClick += OnResizeButtonClicked;
                 guiResizeBtn.OnClick += OnResizeButtonClicked;
-                GUIButton guiClearBtn = new GUIButton("Clear");
+                GUIButton guiClearBtn = new GUIButton("Cl", GUIOption.FixedWidth(20));
                 guiClearBtn.OnClick += OnClearButtonClicked;
                 guiClearBtn.OnClick += OnClearButtonClicked;
 
 
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
                 guiTitleLayout.AddElement(guiFoldout);
                 guiTitleLayout.AddElement(guiFoldout);
                 guiTitleLayout.AddElement(guiSizeField);
                 guiTitleLayout.AddElement(guiSizeField);
+                guiTitleLayout.AddFlexibleSpace();
                 guiTitleLayout.AddElement(guiResizeBtn);
                 guiTitleLayout.AddElement(guiResizeBtn);
                 guiTitleLayout.AddElement(guiClearBtn);
                 guiTitleLayout.AddElement(guiClearBtn);
 
 

+ 11 - 11
MBansheeEditor/Inspector/InspectableList.cs

@@ -38,10 +38,10 @@ namespace BansheeEditor
                     ownsTitleLayout = true;
                     ownsTitleLayout = true;
                 }
                 }
 
 
-                GUIButton cloneBtn = new GUIButton("C");
-                GUIButton deleteBtn = new GUIButton("X");
-                GUIButton moveUpBtn = new GUIButton("Up");
-                GUIButton moveDownBtn = new GUIButton("Down");
+                GUIButton cloneBtn = new GUIButton("C", GUIOption.FixedWidth(20));
+                GUIButton deleteBtn = new GUIButton("X", GUIOption.FixedWidth(20));
+                GUIButton moveUpBtn = new GUIButton("U", GUIOption.FixedWidth(20));
+                GUIButton moveDownBtn = new GUIButton("D", GUIOption.FixedWidth(20));
 
 
                 cloneBtn.OnClick += () => parent.OnCloneButtonClicked(seqIndex);
                 cloneBtn.OnClick += () => parent.OnCloneButtonClicked(seqIndex);
                 deleteBtn.OnClick += () => parent.OnDeleteButtonClicked(seqIndex);
                 deleteBtn.OnClick += () => parent.OnDeleteButtonClicked(seqIndex);
@@ -148,13 +148,14 @@ namespace BansheeEditor
                 guiChildLayout = null;
                 guiChildLayout = null;
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
 
 
-                guiTitleLayout.AddElement(new GUILabel(title));
+                guiTitleLayout.AddElement(new GUILabel(title, GUIOption.FixedWidth(100)));
                 guiTitleLayout.AddElement(new GUILabel("Empty"));
                 guiTitleLayout.AddElement(new GUILabel("Empty"));
 
 
                 if (!property.IsValueType)
                 if (!property.IsValueType)
                 {
                 {
-                    GUIButton createBtn = new GUIButton("Create");
+                    GUIButton createBtn = new GUIButton("Cr", GUIOption.FixedWidth(20));
                     createBtn.OnClick += OnCreateButtonClicked;
                     createBtn.OnClick += OnCreateButtonClicked;
+                    guiTitleLayout.AddFlexibleSpace();
                     guiTitleLayout.AddElement(createBtn);
                     guiTitleLayout.AddElement(createBtn);
                 }
                 }
 
 
@@ -162,19 +163,20 @@ namespace BansheeEditor
             }
             }
             else
             else
             {
             {
-                GUIFoldout guiFoldout = new GUIFoldout(title);
+                GUIFoldout guiFoldout = new GUIFoldout(title, GUIOption.FixedWidth(100));
                 guiFoldout.SetExpanded(isExpanded);
                 guiFoldout.SetExpanded(isExpanded);
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiSizeField = new GUIIntField();
                 guiSizeField = new GUIIntField();
                 guiSizeField.SetRange(0, int.MaxValue);
                 guiSizeField.SetRange(0, int.MaxValue);
-                GUIButton guiResizeBtn = new GUIButton("Resize");
+                GUIButton guiResizeBtn = new GUIButton("R", GUIOption.FixedWidth(20));
                 guiResizeBtn.OnClick += OnResizeButtonClicked;
                 guiResizeBtn.OnClick += OnResizeButtonClicked;
-                GUIButton guiClearBtn = new GUIButton("Clear");
+                GUIButton guiClearBtn = new GUIButton("Cl", GUIOption.FixedWidth(20));
                 guiClearBtn.OnClick += OnClearButtonClicked;
                 guiClearBtn.OnClick += OnClearButtonClicked;
 
 
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
                 guiTitleLayout = layout.AddLayoutX(layoutIndex);
                 guiTitleLayout.AddElement(guiFoldout);
                 guiTitleLayout.AddElement(guiFoldout);
                 guiTitleLayout.AddElement(guiSizeField);
                 guiTitleLayout.AddElement(guiSizeField);
+                guiTitleLayout.AddFlexibleSpace();
                 guiTitleLayout.AddElement(guiResizeBtn);
                 guiTitleLayout.AddElement(guiResizeBtn);
                 guiTitleLayout.AddElement(guiClearBtn);
                 guiTitleLayout.AddElement(guiClearBtn);
 
 
@@ -220,8 +222,6 @@ namespace BansheeEditor
             IList list = property.GetValue<IList>();
             IList list = property.GetValue<IList>();
 
 
             int maxSize = MathEx.Min(size, list.Count);
             int maxSize = MathEx.Min(size, list.Count);
-
-            Debug.Log("List resize: " + list.Count + " - " + newList.Count + " - " + size);
             for (int i = 0; i < maxSize; i++)
             for (int i = 0; i < maxSize; i++)
                 newList[i] = list[i];
                 newList[i] = list[i];
 
 

+ 6 - 4
MBansheeEditor/Inspector/InspectableObject.cs

@@ -61,13 +61,14 @@ namespace BansheeEditor
                 guiChildLayout = null;
                 guiChildLayout = null;
                 guiTitleLayout = layout.AddLayoutX(index);
                 guiTitleLayout = layout.AddLayoutX(index);
 
 
-                guiTitleLayout.AddElement(new GUILabel(title));
+                guiTitleLayout.AddElement(new GUILabel(title, GUIOption.FixedWidth(100)));
                 guiTitleLayout.AddElement(new GUILabel("Empty"));
                 guiTitleLayout.AddElement(new GUILabel("Empty"));
 
 
                 if (!property.IsValueType)
                 if (!property.IsValueType)
                 {
                 {
-                    GUIButton createBtn = new GUIButton("Create");
+                    GUIButton createBtn = new GUIButton("Cr", GUIOption.FixedWidth(20));
                     createBtn.OnClick += OnCreateButtonClicked;
                     createBtn.OnClick += OnCreateButtonClicked;
+                    guiTitleLayout.AddFlexibleSpace();
                     guiTitleLayout.AddElement(createBtn);
                     guiTitleLayout.AddElement(createBtn);
                 }
                 }
             }
             }
@@ -75,13 +76,14 @@ namespace BansheeEditor
             {
             {
                 guiTitleLayout = layout.AddLayoutX(index);
                 guiTitleLayout = layout.AddLayoutX(index);
 
 
-                GUIFoldout guiFoldout = new GUIFoldout(title);
+                GUIFoldout guiFoldout = new GUIFoldout(title, GUIOption.FixedWidth(100));
                 guiFoldout.SetExpanded(isExpanded);
                 guiFoldout.SetExpanded(isExpanded);
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiTitleLayout.AddElement(guiFoldout);
                 guiTitleLayout.AddElement(guiFoldout);
 
 
-                GUIButton clearBtn = new GUIButton("Clear");
+                GUIButton clearBtn = new GUIButton("Cl", GUIOption.FixedWidth(20));
                 clearBtn.OnClick += OnClearButtonClicked;
                 clearBtn.OnClick += OnClearButtonClicked;
+                guiTitleLayout.AddFlexibleSpace();
                 guiTitleLayout.AddElement(clearBtn);
                 guiTitleLayout.AddElement(clearBtn);
 
 
                 if (isExpanded)
                 if (isExpanded)

+ 36 - 20
MBansheeEditor/Inspector/InspectorWindow.cs

@@ -157,8 +157,8 @@ namespace BansheeEditor
             GUILayoutY sceneObjectLayout = sceneObjectPanel.AddLayoutY();
             GUILayoutY sceneObjectLayout = sceneObjectPanel.AddLayoutY();
 
 
             GUILayoutX nameLayout = sceneObjectLayout.AddLayoutX();
             GUILayoutX nameLayout = sceneObjectLayout.AddLayoutX();
-            GUILabel nameLbl = new GUILabel(new LocEdString("Name"), GUIOption.FixedWidth(70));
-            soNameInput = new GUITextBox(false, GUIOption.FlexibleWidth(200));
+            GUILabel nameLbl = new GUILabel(new LocEdString("Name"), GUIOption.FixedWidth(50));
+            soNameInput = new GUITextBox(false, GUIOption.FlexibleWidth(180));
             soNameInput.Text = activeSO.Name;
             soNameInput.Text = activeSO.Name;
             soNameInput.OnChanged += (x) => { if (activeSO != null) activeSO.Name = x; };
             soNameInput.OnChanged += (x) => { if (activeSO != null) activeSO.Name = x; };
 
 
@@ -169,10 +169,10 @@ namespace BansheeEditor
             soPrefabLayout = sceneObjectLayout.AddLayoutX();
             soPrefabLayout = sceneObjectLayout.AddLayoutX();
 
 
             GUILayoutX positionLayout = sceneObjectLayout.AddLayoutX();
             GUILayoutX positionLayout = sceneObjectLayout.AddLayoutX();
-            GUILabel positionLbl = new GUILabel(new LocEdString("Position"), GUIOption.FixedWidth(70));
-            soPosX = new GUIFloatField(new LocEdString("X"), 10, "", GUIOption.FlexibleWidth(50));
-            soPosY = new GUIFloatField(new LocEdString("Y"), 10, "", GUIOption.FlexibleWidth(50));
-            soPosZ = new GUIFloatField(new LocEdString("Z"), 10, "", GUIOption.FlexibleWidth(50));
+            GUILabel positionLbl = new GUILabel(new LocEdString("Position"), GUIOption.FixedWidth(50));
+            soPosX = new GUIFloatField(new LocEdString("X"), 10, "", GUIOption.FixedWidth(60));
+            soPosY = new GUIFloatField(new LocEdString("Y"), 10, "", GUIOption.FixedWidth(60));
+            soPosZ = new GUIFloatField(new LocEdString("Z"), 10, "", GUIOption.FixedWidth(60));
 
 
             soPosX.OnChanged += (x) => OnPositionChanged(0, x);
             soPosX.OnChanged += (x) => OnPositionChanged(0, x);
             soPosY.OnChanged += (y) => OnPositionChanged(1, y);
             soPosY.OnChanged += (y) => OnPositionChanged(1, y);
@@ -181,16 +181,18 @@ namespace BansheeEditor
             positionLayout.AddElement(positionLbl);
             positionLayout.AddElement(positionLbl);
             positionLayout.AddElement(soPosX);
             positionLayout.AddElement(soPosX);
             positionLayout.AddSpace(10);
             positionLayout.AddSpace(10);
+            positionLayout.AddFlexibleSpace();
             positionLayout.AddElement(soPosY);
             positionLayout.AddElement(soPosY);
             positionLayout.AddSpace(10);
             positionLayout.AddSpace(10);
+            positionLayout.AddFlexibleSpace();
             positionLayout.AddElement(soPosZ);
             positionLayout.AddElement(soPosZ);
             positionLayout.AddFlexibleSpace();
             positionLayout.AddFlexibleSpace();
 
 
             GUILayoutX rotationLayout = sceneObjectLayout.AddLayoutX();
             GUILayoutX rotationLayout = sceneObjectLayout.AddLayoutX();
-            GUILabel rotationLbl = new GUILabel(new LocEdString("Rotation"), GUIOption.FixedWidth(70));
-            soRotX = new GUIFloatField(new LocEdString("X"), 10, "", GUIOption.FlexibleWidth(50));
-            soRotY = new GUIFloatField(new LocEdString("Y"), 10, "", GUIOption.FlexibleWidth(50));
-            soRotZ = new GUIFloatField(new LocEdString("Z"), 10, "", GUIOption.FlexibleWidth(50));
+            GUILabel rotationLbl = new GUILabel(new LocEdString("Rotation"), GUIOption.FixedWidth(50));
+            soRotX = new GUIFloatField(new LocEdString("X"), 10, "", GUIOption.FixedWidth(60));
+            soRotY = new GUIFloatField(new LocEdString("Y"), 10, "", GUIOption.FixedWidth(60));
+            soRotZ = new GUIFloatField(new LocEdString("Z"), 10, "", GUIOption.FixedWidth(60));
 
 
             soRotX.OnChanged += (x) => OnRotationChanged(0, x);
             soRotX.OnChanged += (x) => OnRotationChanged(0, x);
             soRotY.OnChanged += (y) => OnRotationChanged(1, y);
             soRotY.OnChanged += (y) => OnRotationChanged(1, y);
@@ -199,16 +201,18 @@ namespace BansheeEditor
             rotationLayout.AddElement(rotationLbl);
             rotationLayout.AddElement(rotationLbl);
             rotationLayout.AddElement(soRotX);
             rotationLayout.AddElement(soRotX);
             rotationLayout.AddSpace(10);
             rotationLayout.AddSpace(10);
+            rotationLayout.AddFlexibleSpace();
             rotationLayout.AddElement(soRotY);
             rotationLayout.AddElement(soRotY);
             rotationLayout.AddSpace(10);
             rotationLayout.AddSpace(10);
+            rotationLayout.AddFlexibleSpace();
             rotationLayout.AddElement(soRotZ);
             rotationLayout.AddElement(soRotZ);
             rotationLayout.AddFlexibleSpace();
             rotationLayout.AddFlexibleSpace();
 
 
             GUILayoutX scaleLayout = sceneObjectLayout.AddLayoutX();
             GUILayoutX scaleLayout = sceneObjectLayout.AddLayoutX();
-            GUILabel scaleLbl = new GUILabel(new LocEdString("Scale"), GUIOption.FixedWidth(70));
-            soScaleX = new GUIFloatField(new LocEdString("X"), 10, "", GUIOption.FlexibleWidth(50));
-            soScaleY = new GUIFloatField(new LocEdString("Y"), 10, "", GUIOption.FlexibleWidth(50));
-            soScaleZ = new GUIFloatField(new LocEdString("Z"), 10, "", GUIOption.FlexibleWidth(50));
+            GUILabel scaleLbl = new GUILabel(new LocEdString("Scale"), GUIOption.FixedWidth(50));
+            soScaleX = new GUIFloatField(new LocEdString("X"), 10, "", GUIOption.FixedWidth(60));
+            soScaleY = new GUIFloatField(new LocEdString("Y"), 10, "", GUIOption.FixedWidth(60));
+            soScaleZ = new GUIFloatField(new LocEdString("Z"), 10, "", GUIOption.FixedWidth(60));
 
 
             soScaleX.OnChanged += (x) => OnScaleChanged(0, x);
             soScaleX.OnChanged += (x) => OnScaleChanged(0, x);
             soScaleY.OnChanged += (y) => OnScaleChanged(1, y);
             soScaleY.OnChanged += (y) => OnScaleChanged(1, y);
@@ -217,8 +221,10 @@ namespace BansheeEditor
             scaleLayout.AddElement(scaleLbl);
             scaleLayout.AddElement(scaleLbl);
             scaleLayout.AddElement(soScaleX);
             scaleLayout.AddElement(soScaleX);
             scaleLayout.AddSpace(10);
             scaleLayout.AddSpace(10);
+            scaleLayout.AddFlexibleSpace();
             scaleLayout.AddElement(soScaleY);
             scaleLayout.AddElement(soScaleY);
             scaleLayout.AddSpace(10);
             scaleLayout.AddSpace(10);
+            scaleLayout.AddFlexibleSpace();
             scaleLayout.AddElement(soScaleZ);
             scaleLayout.AddElement(soScaleZ);
             scaleLayout.AddFlexibleSpace();
             scaleLayout.AddFlexibleSpace();
 
 
@@ -239,14 +245,14 @@ namespace BansheeEditor
                 for (int i = 0; i < numChildren; i++)
                 for (int i = 0; i < numChildren; i++)
                     soPrefabLayout.GetChild(0).Destroy();
                     soPrefabLayout.GetChild(0).Destroy();
 
 
-                GUILabel prefabLabel =new GUILabel(new LocEdString("Prefab"), GUIOption.FixedWidth(70));
+                GUILabel prefabLabel =new GUILabel(new LocEdString("Prefab"), GUIOption.FixedWidth(50));
                 soPrefabLayout.AddElement(prefabLabel);
                 soPrefabLayout.AddElement(prefabLabel);
 
 
                 //if (hasPrefab) // TODO - Disabled check for preview purposes
                 //if (hasPrefab) // TODO - Disabled check for preview purposes
                 {
                 {
-                    GUIButton btnApplyPrefab = new GUIButton(new LocEdString("Apply"));
-                    GUIButton btnRevertPrefab = new GUIButton(new LocEdString("Revert"));
-                    GUIButton btnBreakPrefab = new GUIButton(new LocEdString("Break"));
+                    GUIButton btnApplyPrefab = new GUIButton(new LocEdString("Apply"), GUIOption.FixedWidth(60));
+                    GUIButton btnRevertPrefab = new GUIButton(new LocEdString("Revert"), GUIOption.FixedWidth(60));
+                    GUIButton btnBreakPrefab = new GUIButton(new LocEdString("Break"), GUIOption.FixedWidth(60));
 
 
                     btnApplyPrefab.OnClick += () => PrefabUtility.ApplyPrefab(activeSO);
                     btnApplyPrefab.OnClick += () => PrefabUtility.ApplyPrefab(activeSO);
                     btnRevertPrefab.OnClick += () => PrefabUtility.RevertPrefab(activeSO);
                     btnRevertPrefab.OnClick += () => PrefabUtility.RevertPrefab(activeSO);
@@ -417,7 +423,12 @@ namespace BansheeEditor
                 inspectorScrollArea = new GUIScrollArea();
                 inspectorScrollArea = new GUIScrollArea();
                 GUI.AddElement(inspectorScrollArea);
                 GUI.AddElement(inspectorScrollArea);
                 inspectorLayout = inspectorScrollArea.Layout;
                 inspectorLayout = inspectorScrollArea.Layout;
-                inspectorLayout.AddElement(new GUILabel(new LocEdString("No object selected")));
+
+                inspectorLayout.AddFlexibleSpace();
+                GUILayoutX layoutMsg = inspectorLayout.AddLayoutX();
+                layoutMsg.AddFlexibleSpace();
+                layoutMsg.AddElement(new GUILabel(new LocEdString("No object selected")));
+                layoutMsg.AddFlexibleSpace();
                 inspectorLayout.AddFlexibleSpace();
                 inspectorLayout.AddFlexibleSpace();
             }
             }
             else if ((objects.Length + paths.Length) > 1)
             else if ((objects.Length + paths.Length) > 1)
@@ -426,7 +437,12 @@ namespace BansheeEditor
                 inspectorScrollArea = new GUIScrollArea();
                 inspectorScrollArea = new GUIScrollArea();
                 GUI.AddElement(inspectorScrollArea);
                 GUI.AddElement(inspectorScrollArea);
                 inspectorLayout = inspectorScrollArea.Layout;
                 inspectorLayout = inspectorScrollArea.Layout;
-                inspectorLayout.AddElement(new GUILabel(new LocEdString("Multiple objects selected")));
+
+                inspectorLayout.AddFlexibleSpace();
+                GUILayoutX layoutMsg = inspectorLayout.AddLayoutX();
+                layoutMsg.AddFlexibleSpace();
+                layoutMsg.AddElement(new GUILabel(new LocEdString("Multiple objects selected")));
+                layoutMsg.AddFlexibleSpace();
                 inspectorLayout.AddFlexibleSpace();
                 inspectorLayout.AddFlexibleSpace();
             }
             }
             else if (objects.Length == 1)
             else if (objects.Length == 1)

+ 1 - 1
SBansheeEditor/Source/BsScriptGUIFoldout.cpp

@@ -47,7 +47,7 @@ namespace BansheeEngine
 			options.addOption(mono_array_get(guiOptions, GUIOption, i));
 			options.addOption(mono_array_get(guiOptions, GUIOption, i));
 
 
 		HString label = ScriptGUIContent::getText(content);
 		HString label = ScriptGUIContent::getText(content);
-		GUIFoldout* guiFoldout = GUIFoldout::create(label);
+		GUIFoldout* guiFoldout = GUIFoldout::create(label, options);
 
 
 		guiFoldout->onStateChanged.connect(std::bind(&ScriptGUIFoldout::onToggled, instance, _1));
 		guiFoldout->onStateChanged.connect(std::bind(&ScriptGUIFoldout::onToggled, instance, _1));
 
 

+ 1 - 5
TODO.txt

@@ -62,9 +62,6 @@ Ribek use:
  - Load default layout on initial start
  - Load default layout on initial start
  - Test release mode
  - Test release mode
  - Ability to create assets in Project view (At least Material)
  - Ability to create assets in Project view (At least Material)
- - Need a way to add scene objects and components (and remove them)
-  - Need to add default components (Camera, Renderable, Light) to main menu
-  - Adding scene objects should be doable from context menu in Hierarchy, by dropping a Prefab or by main Menu (undoable)
  - (Optionally, needed for GUI editing) GUISkin resource inspector & a way to inspect and save the default editor skin
  - (Optionally, needed for GUI editing) GUISkin resource inspector & a way to inspect and save the default editor skin
    - Will need C# wrapper for GUISkin (and a way to assign the current skin to a window)
    - Will need C# wrapper for GUISkin (and a way to assign the current skin to a window)
 
 
@@ -74,7 +71,6 @@ First screenshot:
   - Assets (also add to context): Create(Folder, Material, Shader, Script, Prefab, GUI Skin), Show in explorer
   - Assets (also add to context): Create(Folder, Material, Shader, Script, Prefab, GUI Skin), Show in explorer
   - Game Object (also add to context): Create(Empty, Empty Child, Camera, Renderable, Point/Spot/Directional Light), Apply prefab, Break prefab, Revert prefab
   - Game Object (also add to context): Create(Empty, Empty Child, Camera, Renderable, Point/Spot/Directional Light), Apply prefab, Break prefab, Revert prefab
    - Possibly create helper objects: Cube, Sphere, Plane, Quad, Capsule, Cylinder
    - Possibly create helper objects: Cube, Sphere, Plane, Quad, Capsule, Cylinder
-  - Component (also add to inspector context): Camera, Renderable, Point/Spot/Directional light, all other components from scripts
   - Help - About, API Reference (link to site)
   - Help - About, API Reference (link to site)
  - Modify inspector looks by scaling down transform input box sizes, and properly aligning component entries
  - Modify inspector looks by scaling down transform input box sizes, and properly aligning component entries
  - (Optionally) New UI look (tabs, component/array containers, better buttons)
  - (Optionally) New UI look (tabs, component/array containers, better buttons)
@@ -102,7 +98,7 @@ Other polish:
  - Drag to select in scene view
  - Drag to select in scene view
  - MenuBar - will likely need a way to mark elements as disabled when not appropriate (e.g. no "frame selected unless scene is focused")
  - MenuBar - will likely need a way to mark elements as disabled when not appropriate (e.g. no "frame selected unless scene is focused")
    - Likely use a user-provided callback to trigger when populating the menus
    - Likely use a user-provided callback to trigger when populating the menus
- 
+ - Need to list all script components in the Components menu
 
 
 Stage 2 polish:
 Stage 2 polish:
  - Inject an icon into an .exe (Win32 specific)
  - Inject an icon into an .exe (Win32 specific)