Add ControlChildSize option to disable autosizing child controls in UI panel

#2511
This commit is contained in:
Wojtek Figat
2024-09-18 23:19:45 +02:00
parent c9817b25a3
commit a8354720df
3 changed files with 19 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
using System.ComponentModel;
namespace FlaxEngine.GUI
{
/// <summary>
@@ -133,7 +135,7 @@ namespace FlaxEngine.GUI
/// <summary>
/// Gets or sets the value indicating whenever the panel size will be based on a children dimensions.
/// </summary>
[EditorOrder(30), Tooltip("If checked, the panel size will be based on a children dimensions.")]
[EditorOrder(30), DefaultValue(true), Tooltip("If checked, the panel size will be based on a children dimensions.")]
public bool AutoSize
{
get => _autoSize;
@@ -147,6 +149,12 @@ namespace FlaxEngine.GUI
}
}
/// <summary>
/// Gets or sets the value indicating whenever the panel can resize children controls (eg. auto-fit width/height).
/// </summary>
[EditorOrder(35), DefaultValue(true), Tooltip("If checked, the panel can resize children controls (eg. auto-fit width/height).")]
public bool ControlChildSize { get; set; } = true;
/// <summary>
/// Gets or sets the panel area margin.
/// </summary>