Merge branch 'Tryibion-fix-build-tooltip'
This commit is contained in:
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using FlaxEditor.GUI.Docking;
|
using FlaxEditor.GUI.Docking;
|
||||||
using FlaxEditor.Utilities;
|
using FlaxEditor.Utilities;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
|
using FlaxEngine.GUI;
|
||||||
|
|
||||||
namespace FlaxEditor.Options
|
namespace FlaxEditor.Options
|
||||||
{
|
{
|
||||||
@@ -222,9 +223,15 @@ namespace FlaxEditor.Options
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(TextAlignment.Center)]
|
[DefaultValue(TextAlignment.Center)]
|
||||||
[EditorDisplay("Interface"), EditorOrder(321)]
|
[EditorDisplay("Interface"), EditorOrder(321)]
|
||||||
public TextAlignment TooltipTextAlignment { get; set; } = TextAlignment.Center;
|
public TextAlignment TooltipTextAlignment { get => _tooltipTextAlignment;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_tooltipTextAlignment = value;
|
||||||
|
Style.Current.SharedTooltip.HorizontalTextAlignment = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private TextAlignment _tooltipTextAlignment = TextAlignment.Center;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the timestamps prefix mode for output log messages.
|
/// Gets or sets the timestamps prefix mode for output log messages.
|
||||||
|
|||||||
@@ -331,6 +331,7 @@ namespace FlaxEditor.Options
|
|||||||
|
|
||||||
SharedTooltip = new Tooltip(),
|
SharedTooltip = new Tooltip(),
|
||||||
};
|
};
|
||||||
|
style.SharedTooltip.HorizontalTextAlignment = Editor.Instance.Options.Options.Interface.TooltipTextAlignment;
|
||||||
style.DragWindow = style.BackgroundSelected * 0.7f;
|
style.DragWindow = style.BackgroundSelected * 0.7f;
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
@@ -386,6 +387,7 @@ namespace FlaxEditor.Options
|
|||||||
|
|
||||||
SharedTooltip = new Tooltip(),
|
SharedTooltip = new Tooltip(),
|
||||||
};
|
};
|
||||||
|
style.SharedTooltip.HorizontalTextAlignment = Editor.Instance.Options.Options.Interface.TooltipTextAlignment;
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
using FlaxEditor;
|
|
||||||
using FlaxEditor.Options;
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace FlaxEngine.GUI
|
namespace FlaxEngine.GUI
|
||||||
@@ -19,6 +17,11 @@ namespace FlaxEngine.GUI
|
|||||||
private string _currentText;
|
private string _currentText;
|
||||||
private Window _window;
|
private Window _window;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The horizontal alignment of the text.
|
||||||
|
/// </summary>
|
||||||
|
public TextAlignment HorizontalTextAlignment = TextAlignment.Center;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the time in seconds that mouse have to be over the target to show the tooltip.
|
/// Gets or sets the time in seconds that mouse have to be over the target to show the tooltip.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -238,7 +241,7 @@ namespace FlaxEngine.GUI
|
|||||||
|
|
||||||
// Padding for text
|
// Padding for text
|
||||||
var textRect = GetClientArea();
|
var textRect = GetClientArea();
|
||||||
float textX = Editor.Instance.Options.Options.Interface.TooltipTextAlignment switch
|
float textX = HorizontalTextAlignment switch
|
||||||
{
|
{
|
||||||
TextAlignment.Near => 15,
|
TextAlignment.Near => 15,
|
||||||
TextAlignment.Center => 5,
|
TextAlignment.Center => 5,
|
||||||
@@ -254,7 +257,7 @@ namespace FlaxEngine.GUI
|
|||||||
_currentText,
|
_currentText,
|
||||||
textRect,
|
textRect,
|
||||||
style.Foreground,
|
style.Foreground,
|
||||||
Editor.Instance.Options.Options.Interface.TooltipTextAlignment,
|
HorizontalTextAlignment,
|
||||||
TextAlignment.Center,
|
TextAlignment.Center,
|
||||||
TextWrapping.WrapWords
|
TextWrapping.WrapWords
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user