diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml index 22aa8f597..e200a187f 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml @@ -117,7 +117,7 @@ HorizontalAlignment="Right" VerticalAlignment="Top" Style="{DynamicResource PreviewItemSubTitleStyle}" - Text="{Binding FileSize, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" + Text="{Binding FileSize, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Mode=OneWay}" TextWrapping="Wrap" Visibility="{Binding FileSizeVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" /> diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index a3a0ad0aa..ec60a3c13 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -20,7 +20,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged private static readonly string ClassName = nameof(PreviewPanel); private string FilePath { get; } - public string FileSize { get; } = ""; + public string FileSize { get; private set; } = Main.Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_unknown"); public string CreatedAt { get; } = ""; public string LastModifiedAt { get; } = ""; private ImageSource _previewImage = new BitmapImage(); @@ -63,7 +63,18 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged if (Settings.ShowFileSizeInPreviewPanel) { - FileSize = type == ResultType.File ? GetFileSize(filePath) : GetFolderSize(filePath); + if (type == ResultType.File) + { + FileSize = GetFileSize(filePath); + } + else + { + _ = Task.Run(() => + { + FileSize = GetFolderSize(filePath); + OnPropertyChanged(nameof(FileSize)); + }).ConfigureAwait(false); + } } if (Settings.ShowCreatedDateInPreviewPanel)