Add Git overlay, operation tools, and virtualized preview so large folders stay responsive.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,14 +29,27 @@ public sealed partial class FolderItemViewModel : ObservableObject
|
||||
EditName = Item.Name;
|
||||
}
|
||||
|
||||
public FileSystemItem Item { get; }
|
||||
public bool SizeFromIndex { get; }
|
||||
public FileSystemItem Item { get; private set; }
|
||||
public bool SizeFromIndex { get; private set; }
|
||||
|
||||
public void Apply(FileSystemItem item, bool? sizeFromIndex = null)
|
||||
{
|
||||
Item = item;
|
||||
if (sizeFromIndex is bool value)
|
||||
{
|
||||
SizeFromIndex = value;
|
||||
}
|
||||
|
||||
OnPropertyChanged(string.Empty);
|
||||
}
|
||||
public string Name => Item.DisplayName ?? Item.Name;
|
||||
public string FullPath => Item.FullPath;
|
||||
public bool IsDirectory => Item.IsDirectory;
|
||||
public string TypeLabel => Item.Location.IsRecycleBin
|
||||
? "Recycle Bin"
|
||||
: Item.IsDirectory ? "File folder" : (Item.ExtensionDisplay());
|
||||
public string TypeLabel => Item.AvailableToImport
|
||||
? "Available in Windows"
|
||||
: Item.Location.IsRecycleBin
|
||||
? "Recycle Bin"
|
||||
: Item.IsDirectory ? "File folder" : (Item.ExtensionDisplay());
|
||||
public string SizeLabel => Item.SizeKnowledge switch
|
||||
{
|
||||
SizeKnowledge.Unknown when Item.Location.AccessDenied => "Access denied",
|
||||
@@ -62,6 +75,22 @@ public sealed partial class FolderItemViewModel : ObservableObject
|
||||
|| AttributeFlags.MayHydrateOnRead(Item.Attributes);
|
||||
public string CloudStatus => Item.Cloud?.StatusText ?? "";
|
||||
public bool HasCloudStatus => !string.IsNullOrEmpty(CloudStatus);
|
||||
|
||||
[ObservableProperty] private string _gitLabel = "";
|
||||
public bool HasGitLabel => !string.IsNullOrEmpty(GitLabel);
|
||||
|
||||
[ObservableProperty] private object? _thumbnail;
|
||||
public bool HasThumbnail => Thumbnail is not null;
|
||||
|
||||
public void SetGit(GitStatus? status)
|
||||
{
|
||||
GitLabel = status?.Badge ?? "";
|
||||
}
|
||||
|
||||
public void SetThumbnail(object? image) => Thumbnail = image;
|
||||
|
||||
partial void OnGitLabelChanged(string value) => OnPropertyChanged(nameof(HasGitLabel));
|
||||
partial void OnThumbnailChanged(object? value) => OnPropertyChanged(nameof(HasThumbnail));
|
||||
public string SizeTooltip
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user