Add Tab navigation for Editor UI
This commit is contained in:
@@ -83,7 +83,7 @@ namespace FlaxEditor.Content.Import
|
||||
Offsets = new Margin(-ButtonsWidth - ButtonsMargin, ButtonsWidth, -ButtonsHeight - ButtonsMargin, ButtonsHeight),
|
||||
Parent = this
|
||||
};
|
||||
importButton.Clicked += OnImport;
|
||||
importButton.Clicked += OnSubmit;
|
||||
var cancelButton = new Button
|
||||
{
|
||||
Text = "Cancel",
|
||||
@@ -223,24 +223,6 @@ namespace FlaxEditor.Content.Import
|
||||
}
|
||||
}
|
||||
|
||||
private void OnImport()
|
||||
{
|
||||
var entries = new List<ImportFileEntry>(_rootNode.ChildrenCount);
|
||||
for (int i = 0; i < _rootNode.ChildrenCount; i++)
|
||||
{
|
||||
if (_rootNode.Children[i].Tag is ImportFileEntry fileEntry)
|
||||
entries.Add(fileEntry);
|
||||
}
|
||||
Editor.Instance.ContentImporting.LetThemBeImportedxD(entries);
|
||||
|
||||
Close(DialogResult.OK);
|
||||
}
|
||||
|
||||
private void OnCancel()
|
||||
{
|
||||
Close(DialogResult.Cancel);
|
||||
}
|
||||
|
||||
private void OnSelectedChanged(List<TreeNode> before, List<TreeNode> after)
|
||||
{
|
||||
var selection = new List<object>(after.Count);
|
||||
@@ -253,6 +235,20 @@ namespace FlaxEditor.Content.Import
|
||||
_settingsEditor.Select(selection);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSubmit()
|
||||
{
|
||||
var entries = new List<ImportFileEntry>(_rootNode.ChildrenCount);
|
||||
for (int i = 0; i < _rootNode.ChildrenCount; i++)
|
||||
{
|
||||
if (_rootNode.Children[i].Tag is ImportFileEntry fileEntry)
|
||||
entries.Add(fileEntry);
|
||||
}
|
||||
Editor.Instance.ContentImporting.LetThemBeImportedxD(entries);
|
||||
|
||||
base.OnSubmit();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void SetupWindowSettings(ref CreateWindowSettings settings)
|
||||
{
|
||||
@@ -261,24 +257,5 @@ namespace FlaxEditor.Content.Import
|
||||
settings.MinimumSize = new Vector2(300, 400);
|
||||
settings.HasSizingFrame = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnKeyDown(KeyboardKeys key)
|
||||
{
|
||||
if (base.OnKeyDown(key))
|
||||
return true;
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case KeyboardKeys.Escape:
|
||||
OnCancel();
|
||||
return true;
|
||||
case KeyboardKeys.Return:
|
||||
OnImport();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user