Add GroupElement.AddSettingsButton for editor ui

This commit is contained in:
Wojtek Figat
2023-04-29 11:10:48 +02:00
parent 8de2e6a424
commit 4d1ac04e5c
3 changed files with 28 additions and 40 deletions

View File

@@ -95,19 +95,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
if (actor != null)
group.Panel.TooltipText = Surface.SurfaceUtils.GetVisualScriptTypeDescription(TypeUtils.GetObjectType(actor));
float settingsButtonSize = group.Panel.HeaderHeight;
var settingsButton = new Image
{
TooltipText = "Settings",
AutoFocus = true,
AnchorPreset = AnchorPresets.TopRight,
Parent = group.Panel,
Bounds = new Rectangle(group.Panel.Width - settingsButtonSize, 0, settingsButtonSize, settingsButtonSize),
IsScrollable = false,
Color = FlaxEngine.GUI.Style.Current.ForegroundGrey,
Margin = new Margin(1),
Brush = new SpriteBrush(FlaxEngine.GUI.Style.Current.Settings),
};
var settingsButton = group.AddSettingsButton();
settingsButton.Clicked += OnSettingsButtonClicked;
break;
}