Refactor Control autofocus to be handled by control type instead of as part of base.OnMouseDown

This commit is contained in:
Wojtek Figat
2021-11-05 18:17:07 +01:00
parent 1c579ae69c
commit 214e626ac5
7 changed files with 56 additions and 40 deletions

View File

@@ -597,6 +597,14 @@ namespace FlaxEditor.Content.GUI
}
}
/// <inheritdoc />
public override bool OnMouseDown(Vector2 location, MouseButton button)
{
if (base.OnMouseDown(location, button))
return true;
return AutoFocus && Focus(this);
}
/// <inheritdoc />
public override bool OnMouseWheel(Vector2 location, float delta)
{