Add better tooltips to all files and folders.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using FlaxEditor.GUI.Drag;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
@@ -137,7 +138,13 @@ namespace FlaxEditor.Content
|
||||
/// <inheritdoc />
|
||||
public override void UpdateTooltipText()
|
||||
{
|
||||
TooltipText = Path;
|
||||
string fileDescription = "Folder";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("Type: ").Append(fileDescription).AppendLine();
|
||||
sb.Append("Path: ").Append(Utilities.Utils.GetAssetNamePathWithExt(Path)).AppendLine();
|
||||
|
||||
TooltipText = sb.ToString();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using FlaxEditor.Content.GUI;
|
||||
using FlaxEditor.GUI.Drag;
|
||||
using FlaxEngine;
|
||||
@@ -353,13 +355,19 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the tooltip text text.
|
||||
/// Updates the tooltip text.
|
||||
/// </summary>
|
||||
public virtual void UpdateTooltipText()
|
||||
{
|
||||
Editor.Log(FlaxEditor.Utilities.Utils.GetAssetNamePath(Path));
|
||||
string fileExtension = System.IO.Path.GetExtension(Path);
|
||||
string fileDescription = Utilities.Utils.TranslateFileExtension(fileExtension);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
TooltipText = "Path: " + Path;
|
||||
sb.Append("Type: ").Append(fileDescription).AppendLine();
|
||||
sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((int)new FileInfo(Path).Length)).AppendLine();
|
||||
sb.Append("Path: ").Append(Utilities.Utils.GetAssetNamePathWithExt(Path)).AppendLine();
|
||||
|
||||
TooltipText = sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user