diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index d8493a70a..ea3d613a0 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -217,6 +217,15 @@ namespace FlaxEditor.Options [EditorDisplay("Interface"), EditorOrder(320), Tooltip("Toggles tree line visibility in places like the Scene or Content Panel.")] public bool ShowTreeLines { get; set; } = true; + /// + /// Gets or sets tooltip text alignment. + /// + [DefaultValue(TextAlignment.Center)] + [EditorDisplay("Interface"), EditorOrder(321)] + public TextAlignment TooltipTextAlignment { get; set; } = TextAlignment.Center; + + + /// /// Gets or sets the timestamps prefix mode for output log messages. /// diff --git a/Source/Engine/UI/GUI/Tooltip.cs b/Source/Engine/UI/GUI/Tooltip.cs index a7f80e152..dbd91ffef 100644 --- a/Source/Engine/UI/GUI/Tooltip.cs +++ b/Source/Engine/UI/GUI/Tooltip.cs @@ -1,5 +1,7 @@ // Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +using FlaxEditor; +using FlaxEditor.Options; using System; namespace FlaxEngine.GUI @@ -236,7 +238,15 @@ namespace FlaxEngine.GUI // Padding for text var textRect = GetClientArea(); - textRect.X += 5; + + float textX = Editor.Instance.Options.Options.Interface.TooltipTextAlignment switch + { + TextAlignment.Near => 15, + TextAlignment.Center => 5, + TextAlignment.Far => -5, + }; + + textRect.X += textX; textRect.Width -= 10; // Tooltip text @@ -245,7 +255,7 @@ namespace FlaxEngine.GUI _currentText, textRect, style.Foreground, - TextAlignment.Center, + Editor.Instance.Options.Options.Interface.TooltipTextAlignment, TextAlignment.Center, TextWrapping.WrapWords );