From 47f9bc2017e11b04dfc969b69253e1e98dae7c0a Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 24 May 2023 09:47:27 +0200 Subject: [PATCH] Fix regression in Content Item tooltip #1085 --- Source/Editor/Content/Items/ContentItem.cs | 5 +++-- Source/Editor/Content/Items/NewItem.cs | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Content/Items/ContentItem.cs b/Source/Editor/Content/Items/ContentItem.cs index 2a0390b30..66825fb42 100644 --- a/Source/Editor/Content/Items/ContentItem.cs +++ b/Source/Editor/Content/Items/ContentItem.cs @@ -384,7 +384,8 @@ namespace FlaxEditor.Content protected virtual void OnBuildTooltipText(StringBuilder sb) { sb.Append("Type: ").Append(TypeDescription).AppendLine(); - sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((int)new FileInfo(Path).Length)).AppendLine(); + if (File.Exists(Path)) + sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((int)new FileInfo(Path).Length)).AppendLine(); sb.Append("Path: ").Append(Utilities.Utils.GetAssetNamePathWithExt(Path)).AppendLine(); } @@ -718,7 +719,7 @@ namespace FlaxEditor.Content public override bool OnMouseDoubleClick(Float2 location, MouseButton button) { Focus(); - + // Open (Parent as ContentView).OnItemDoubleClick(this); diff --git a/Source/Editor/Content/Items/NewItem.cs b/Source/Editor/Content/Items/NewItem.cs index 94d95f15b..7040adf44 100644 --- a/Source/Editor/Content/Items/NewItem.cs +++ b/Source/Editor/Content/Items/NewItem.cs @@ -1,5 +1,6 @@ // Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. +using System.Text; using FlaxEngine; namespace FlaxEditor.Content @@ -47,5 +48,11 @@ namespace FlaxEditor.Content /// protected override bool DrawShadow => true; + + /// + public override void UpdateTooltipText() + { + TooltipText = null; + } } }