Minor fixes to content window navigation
This commit is contained in:
@@ -692,10 +692,13 @@ namespace FlaxEditor.Content.GUI
|
|||||||
c = char.ToLowerInvariant(c);
|
c = char.ToLowerInvariant(c);
|
||||||
for (int i = 0; i < _items.Count; i++)
|
for (int i = 0; i < _items.Count; i++)
|
||||||
{
|
{
|
||||||
var name = _items[i].ShortName;
|
var item = _items[i];
|
||||||
|
var name = item.ShortName;
|
||||||
if (!string.IsNullOrEmpty(name) && char.ToLowerInvariant(name[0]) == c)
|
if (!string.IsNullOrEmpty(name) && char.ToLowerInvariant(name[0]) == c)
|
||||||
{
|
{
|
||||||
Select(_items[i]);
|
Select(item);
|
||||||
|
if (Parent is Panel panel)
|
||||||
|
panel.ScrollViewTo(item, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -611,19 +611,15 @@ namespace FlaxEditor.Windows
|
|||||||
/// <param name="files">The files paths to import.</param>
|
/// <param name="files">The files paths to import.</param>
|
||||||
public void Paste(string[] files)
|
public void Paste(string[] files)
|
||||||
{
|
{
|
||||||
List<string> importFiles = new List<string>();
|
var importFiles = new List<string>();
|
||||||
foreach (var sourcePath in files)
|
foreach (var sourcePath in files)
|
||||||
{
|
{
|
||||||
var item = Editor.ContentDatabase.Find(sourcePath);
|
var item = Editor.ContentDatabase.Find(sourcePath);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
Editor.ContentDatabase.Copy(item, Path.Combine(CurrentViewFolder.Path, item.FileName));
|
||||||
string targetPath = Path.Combine(CurrentViewFolder.Path, item.FileName);
|
|
||||||
Editor.ContentDatabase.Copy(item, targetPath);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
importFiles.Add(sourcePath);
|
importFiles.Add(sourcePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
Editor.ContentImporting.Import(importFiles, CurrentViewFolder);
|
Editor.ContentImporting.Import(importFiles, CurrentViewFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user