diff --git a/editor/Assets/AssetBrowserView.axaml b/editor/Assets/AssetBrowserView.axaml
index 42522589d..15b925aa9 100644
--- a/editor/Assets/AssetBrowserView.axaml
+++ b/editor/Assets/AssetBrowserView.axaml
@@ -140,11 +140,26 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+ TextTrimming="CharacterEllipsis"
+ VerticalAlignment="Center" Classes="compact-text" />
+
+
+
+
+
+
diff --git a/editor/Assets/AssetBrowserView.axaml.cs b/editor/Assets/AssetBrowserView.axaml.cs
index c537fcc92..e1492543a 100644
--- a/editor/Assets/AssetBrowserView.axaml.cs
+++ b/editor/Assets/AssetBrowserView.axaml.cs
@@ -79,8 +79,12 @@ private void OnSelectTemplateKey(object? sender, SelectTemplateEventArgs e) {
private void OnCardPointerPressed(object? sender, PointerPressedEventArgs e) {
var point = e.GetCurrentPoint(this);
if (point.Properties.IsRightButtonPressed) {
- if (GetCardItem(e.Source) is AssetFile rightClickedFile)
- PrepareFileContextMenu(e.Source, rightClickedFile);
+ if (GetCardItem(e.Source) is { } rightClicked) {
+ if (!Vm.SelectedItems.Contains(rightClicked)) Vm.SelectItem(rightClicked, KeyModifiers.None);
+ if (rightClicked is AssetFile rightClickedFile) PrepareFileContextMenu(e.Source, rightClickedFile);
+ e.Handled = true;
+ }
+
return;
}
@@ -382,7 +386,8 @@ private async void Import_OnClick(object? sender, RoutedEventArgs e) {
if (!Vm.CanWriteToSelectedFolder) return;
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return;
- var importWindow = new ImportWindow();
+ var destination = Vm.SelectedFolder is { } folder ? ProjectContext.ToVirtual(folder.Filepath) : null;
+ var importWindow = new ImportWindow(destination);
await importWindow.ShowDialog(owner);
}
diff --git a/editor/Assets/AssetBrowserViewModel.cs b/editor/Assets/AssetBrowserViewModel.cs
index adebf9458..6c3fae51d 100644
--- a/editor/Assets/AssetBrowserViewModel.cs
+++ b/editor/Assets/AssetBrowserViewModel.cs
@@ -23,6 +23,7 @@
using editor.Git;
using editor.Workspace;
using Lucide.Avalonia;
+using editor.Components.Elements;
namespace editor.Assets;
@@ -220,6 +221,29 @@ public bool? FilterAll {
}
public ObservableCollection TagFilters { get; } = [];
+ private bool m_showTagsView;
+ private AssetTag? m_selectedTag;
+ public ObservableCollection Tags => AssetBrowserSettings.Tags;
+ public bool ShowTagsView => m_showTagsView;
+ public bool ShowFoldersView => !m_showTagsView;
+ public string SidebarTitle => m_showTagsView ? "Tags" : "Folders";
+ public IRelayCommand ToggleTagsViewCommand => new RelayCommand(() => {
+ m_showTagsView = !m_showTagsView;
+ if (!m_showTagsView) SelectedTag = null;
+ Notify(nameof(ShowTagsView));
+ Notify(nameof(ShowFoldersView));
+ Notify(nameof(SidebarTitle));
+ });
+
+ public AssetTag? SelectedTag {
+ get => m_selectedTag;
+ set {
+ if (m_selectedTag == value) return;
+ m_selectedTag = value;
+ Notify();
+ SearchText = value is null ? "" : $"Tag=\"{value.Name}\"";
+ }
+ }
public bool HasTags => AssetBrowserSettings.Tags.Count > 0;
@@ -1155,7 +1179,7 @@ private void RefreshCurrentItems() {
.Where(f => search.Type is null || f.Definition == search.Type)
.Where(f => search.Tags.Count == 0 || MatchesTagTerms(f, search.Tags))
.Where(f => string.IsNullOrEmpty(search.Text) ||
- f.Name.Contains(search.Text, StringComparison.OrdinalIgnoreCase));
+ FuzzyMatcher.Matches(f.Name, search.Text));
items = SortFiles(files).Cast