From ef7aefd7b8fd80055bc1e4c91079c406b848953c Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 4 Aug 2026 19:19:34 +0200 Subject: [PATCH] Refactor window tooltip to use string builder #4135 --- Source/Editor/Modules/UIModule.cs | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs index 62f514040..1e6fec14c 100644 --- a/Source/Editor/Modules/UIModule.cs +++ b/Source/Editor/Modules/UIModule.cs @@ -817,27 +817,40 @@ namespace FlaxEditor.Modules private void InitWindowDecorations(RootControl mainWindow) { ScriptsBuilder.GetBinariesConfiguration(out _, out _, out _, out var configuration); - string driver = string.Empty; -#if PLATFORM_LINUX - driver = LinuxPlatform.DisplayServer; - if (!string.IsNullOrEmpty(driver)) - driver = $" ({driver})"; -#endif + var tooltip = new System.Text.StringBuilder(); + + // Project info + tooltip.AppendLine(Editor.GameProject.Name); var projectPath = Globals.ProjectFolder; #if PLATFORM_WINDOWS projectPath = projectPath.Replace('/', '\\'); #endif + tooltip.AppendLine(projectPath); - string largeWorld = ""; + // Engine info + tooltip.Append("Engine Version: ").AppendLine(Globals.EngineVersion); + var engineNickname = Editor.EngineProject.EngineNickname; + if (!string.IsNullOrEmpty(engineNickname)) + tooltip.Append($" ({engineNickname})"); + + // Build info #if USE_LARGE_WORLDS - largeWorld = "\nLarge Worlds Enabled"; + tooltip.AppendLine("Large Worlds Enabled"); #endif + tooltip.Append("Configuration: ").AppendLine(configuration); + tooltip.Append("Graphics: ").Append(GPUDevice.Instance.RendererType); +#if PLATFORM_LINUX + var driver = LinuxPlatform.DisplayServer; + if (!string.IsNullOrEmpty(driver)) + tooltip.Append($" ({driver})"); +#endif + tooltip.AppendLine(); WindowDecorations = new MainWindowDecorations(mainWindow, !Utilities.Utils.UseCustomWindowDecorations(true)) { Parent = mainWindow, - IconTooltipText = $"{mainWindow.RootWindow.Title}\nPath {projectPath}\n\nEngine Version {Globals.EngineVersion}{largeWorld}\nConfiguration {configuration}\n\nGraphics {GPUDevice.Instance.RendererType}{driver}", + IconTooltipText = tooltip.ToString(), }; }