Fix AutoFocus on ContainerControl to be false by default

This commit is contained in:
Wojtek Figat
2025-07-15 12:33:33 +02:00
parent c0cce748cc
commit 9646dd3fc2
13 changed files with 24 additions and 3 deletions

View File

@@ -381,6 +381,8 @@ namespace FlaxEngine.GUI
public Dropdown()
: base(0, 0, 120, 18.0f)
{
AutoFocus = true;
var style = Style.Current;
Font = new FontReference(style.FontMedium);
TextColor = style.Foreground;

View File

@@ -298,6 +298,8 @@ public class Slider : ContainerControl
public Slider(float width, float height)
: base(0, 0, width, height)
{
AutoFocus = true;
var style = Style.Current;
TrackLineColor = style.BackgroundHighlighted;
TrackFillLineColor = style.LightBackground;

View File

@@ -511,6 +511,8 @@ namespace FlaxEngine.GUI
protected TextBoxBase(bool isMultiline, float x, float y, float width = 120)
: base(x, y, width, DefaultHeight)
{
AutoFocus = true;
_isMultiline = isMultiline;
_maxLength = 2147483646;
_selectionStart = _selectionEnd = -1;

View File

@@ -38,6 +38,7 @@ namespace FlaxEngine.GUI
public ContainerControl()
{
_isLayoutLocked = true;
AutoFocus = false;
}
/// <summary>
@@ -47,6 +48,7 @@ namespace FlaxEngine.GUI
: base(x, y, width, height)
{
_isLayoutLocked = true;
AutoFocus = false;
}
/// <summary>
@@ -56,6 +58,7 @@ namespace FlaxEngine.GUI
: base(location, size)
{
_isLayoutLocked = true;
AutoFocus = false;
}
/// <inheritdoc />
@@ -63,6 +66,7 @@ namespace FlaxEngine.GUI
: base(bounds)
{
_isLayoutLocked = true;
AutoFocus = false;
}
/// <summary>

View File

@@ -165,6 +165,8 @@ namespace FlaxEngine.GUI
public RadialMenu(float x, float y, float width = 100, float height = 100)
: base(x, y, width, height)
{
AutoFocus = true;
var style = Style.Current;
if (style != null)
{