Quellcode durchsuchen

Fixed an issue with invisible title bars
Fixed an issue with unique path generation in project window
Better looking progress bar

Marko Pintera vor 10 Jahren
Ursprung
Commit
566ef00248

+ 5 - 0
BansheeEditor/Include/BsGUITabbedTitleBar.h

@@ -38,6 +38,11 @@ namespace BansheeEngine
 
 		void updateClippedBounds();
 
+		/**
+		 * @copydoc GUIElementContainer::_getOptimalSize
+		 */
+		Vector2I _getOptimalSize() const override;
+
 		void _updateLayoutInternal(const GUILayoutData& data);
 	protected:
 		static const UINT32 TAB_SPACING;

+ 21 - 0
BansheeEditor/Source/BsGUITabbedTitleBar.cpp

@@ -232,6 +232,27 @@ namespace BansheeEngine
 		mClippedBounds = mLayoutData.area;
 	}
 
+	Vector2I GUITabbedTitleBar::_getOptimalSize() const
+	{
+		Vector2I optimalSize = mMinBtn->_getOptimalSize();
+		optimalSize.x += OPTION_BTN_SPACING + 1;
+
+		Vector2I closeBtnOptimalSize = mCloseBtn->_getOptimalSize();
+		optimalSize.x += closeBtnOptimalSize.x;
+		optimalSize.y = std::max(optimalSize.y, closeBtnOptimalSize.y);
+
+		for (UINT32 i = 0; i < (UINT32)mTabButtons.size(); i++)
+		{
+			GUITabButton* btn = mTabButtons[i];
+			Vector2I btnOptimalSize = btn->_getOptimalSize();
+
+			optimalSize.x += btnOptimalSize.x + TAB_SPACING;
+			optimalSize.y = std::max(optimalSize.y, btnOptimalSize.y);
+		}
+
+		return optimalSize;
+	}
+
 	void GUITabbedTitleBar::_updateLayoutInternal(const GUILayoutData& data)
 	{
 		Vector2I minBtnOptimalSize = mMinBtn->_getOptimalSize();

+ 3 - 3
MBansheeEditor/ProgressBar.cs

@@ -31,7 +31,7 @@ namespace BansheeEditor
 
         private void Initialize(LocString title, LocString message, float percent)
         {
-            Width = 250;
+            Width = 350;
             Height = 75;
 
             Title = title;
@@ -67,9 +67,9 @@ namespace BansheeEditor
             layoutY.AddSpace(10);
 
             GUILayoutX barLayout = layoutY.AddLayoutX();
-            barLayout.AddSpace(10);
+            barLayout.AddSpace(30);
             barLayout.AddElement(progressBar);
-            barLayout.AddSpace(10);
+            barLayout.AddSpace(30);
 
             layoutY.AddFlexibleSpace();
         }

+ 11 - 1
MBansheeEditor/ProjectLibrary.cs

@@ -120,7 +120,17 @@ namespace BansheeEditor
                 foreach (var entry in queuedForImport)
                 {
                     float pct = numImportedFiles/(float)totalFilesToImport;
-                    ProgressBar.Show("Importing (" + numImportedFiles + "/" + totalFilesToImport + ")", entry, pct);
+
+                    string displayName = entry;
+                    displayName = displayName.Replace("\\", "\\\\");
+
+                    if (displayName.Length > 60)
+                    {
+                        displayName = displayName.Remove(0, displayName.Length - 60);
+                        displayName = "..." + displayName;
+                    }
+
+                    ProgressBar.Show("Importing (" + numImportedFiles + "/" + totalFilesToImport + ")", displayName, pct);
 
                     Internal_Refresh(entry, true);
                     toRemove.Add(entry);

+ 3 - 3
MBansheeEditor/ProjectWindow.cs

@@ -847,12 +847,12 @@ namespace BansheeEditor
                 pathNoExtension = path.Remove(path.Length - extension.Length);
 
             int idx = 0;
-            string destination;
-            do
+            string destination = pathNoExtension;
+            while (ProjectLibrary.Exists(destination))
             {
                 destination = pathNoExtension + "_" + idx;
                 idx++;
-            } while (!ProjectLibrary.Exists(destination));
+            }
 
             return destination + extension;
         }

+ 3 - 2
TODO.txt

@@ -21,11 +21,12 @@ GUIResourceField doesn't distinguish between tex2d, tex3d and texcube.
 When windows first open they show up as all black. This is problematic with progress bar window since it may appear for just one frame and it only shows up as black square during that time.
  - Later on after I fix this issue I should probably just make a special case and not open the progress bar if all import is done in one go
 
-Test DoOnDragDropped with a folder. I feel the copy/move methods might break because they don't properly retrieve folder name.
-
 I'm not sure if queued dependencies are handled properly. They're handled on an internal ProjectLibrary loop but perhaps I should
 return them in checkForModifications?
 
+Window titlebars and focus borders no longer render!?
+ - Might be after my change to fix zero width/height elements in layouts
+
 ----------------------------------------------------------------------
 Project window