Add Alignment option to Vertical and Horizonal Panels

#2599
This commit is contained in:
Wojtek Figat
2024-10-22 21:55:25 +02:00
parent f62c77c35c
commit 09c0d0d29d
3 changed files with 58 additions and 0 deletions

View File

@@ -30,6 +30,11 @@ namespace FlaxEngine.GUI
/// </summary>
protected Float2 _offset;
/// <summary>
/// The child controls alignment within layout area.
/// </summary>
protected TextAlignment _alignment = TextAlignment.Near;
/// <summary>
/// Gets or sets the left margin.
/// </summary>
@@ -172,6 +177,23 @@ namespace FlaxEngine.GUI
}
}
/// <summary>
/// Gets or sets the child controls alignment within layout area.
/// </summary>
[EditorOrder(50), VisibleIf(nameof(AutoSize), true)]
public TextAlignment Alignment
{
get => _alignment;
set
{
if (_alignment != value)
{
_alignment = value;
PerformLayout();
}
}
}
/// <summary>
/// Initializes a new instance of the <see cref="PanelWithMargins"/> class.
/// </summary>