Skip to content

Commit 8233c7e

Browse files
authored
Status bar: Show total size of selected files (#1188)
1 parent 134e258 commit 8233c7e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Files/BaseLayout.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,20 @@ internal set
8787
else
8888
{
8989
SelectedItemsPropertiesViewModel.SelectedItemsCount = SelectedItems.Count.ToString() + " " + ResourceController.GetTranslation("ItemsSelected/Text");
90-
SelectedItemsPropertiesViewModel.ItemsSize = ""; // We need to loop through the items to get the size
90+
91+
if (SelectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.File))
92+
{
93+
long size = 0;
94+
foreach (var item in SelectedItems)
95+
{
96+
size += item.FileSizeBytes;
97+
}
98+
SelectedItemsPropertiesViewModel.ItemsSize = ByteSizeLib.ByteSize.FromBytes(size).ToBinaryString().ConvertSizeAbbreviation();
99+
}
100+
else
101+
{
102+
SelectedItemsPropertiesViewModel.ItemsSize = string.Empty;
103+
}
91104
}
92105
}
93106
NotifyPropertyChanged("SelectedItems");

0 commit comments

Comments
 (0)