Add Tab navigation for Editor UI

This commit is contained in:
Wojciech Figat
2021-12-21 18:13:45 +01:00
parent c178afdf6b
commit af75751bf1
15 changed files with 293 additions and 195 deletions

View File

@@ -527,7 +527,7 @@ namespace FlaxEditor.Modules
Text = "OK",
Parent = this,
};
okButton.Clicked += OnOk;
okButton.Clicked += OnSubmit;
var cancelButton = new Button(okButton.Left - 54, okButton.Y, 50)
{
@@ -539,7 +539,8 @@ namespace FlaxEditor.Modules
_dialogSize = okButton.BottomRight + new Vector2(8);
}
private void OnOk()
/// <inheritdoc />
public override void OnSubmit()
{
var name = _textbox.Text;
if (name.Length == 0)
@@ -553,32 +554,11 @@ namespace FlaxEditor.Modules
return;
}
Close(DialogResult.OK);
base.OnSubmit();
var path = StringUtils.CombinePaths(Globals.ProjectCacheFolder, "Layout_" + name + ".xml");
Editor.Instance.Windows.SaveLayout(path);
}
private void OnCancel()
{
Close(DialogResult.Cancel);
}
/// <inheritdoc />
public override bool OnKeyDown(KeyboardKeys key)
{
switch (key)
{
case KeyboardKeys.Escape:
OnCancel();
return true;
case KeyboardKeys.Return:
OnOk();
return true;
}
return base.OnKeyDown(key);
}
}
/// <summary>