Skip to content

Commit 9613c44

Browse files
committed
Fix
1 parent ced5620 commit 9613c44

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/Files.App/UserControls/AddressToolbar.xaml.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,10 @@ private async Task AddHistoryItemsAsync(IEnumerable<PageStackEntry> items, IList
198198

199199
private async Task LoadFlyoutItemIconAsync(MenuFlyoutItem flyoutItem, string path)
200200
{
201-
var result = await FileThumbnailHelper.GetIconAsync(
202-
path,
203-
Constants.ShellIconSizes.Small,
204-
true,
205-
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
201+
var imageSource = await NavigationHelpers.GetIconForPathAsync(path);
206202

207-
if (result is not null)
208-
{
209-
var imageSource = await result.ToBitmapAsync();
203+
if (imageSource is not null)
210204
flyoutItem.Icon = new ImageIcon { Source = imageSource };
211-
}
212205
}
213206

214207
private void HistoryItemClicked(ToolbarHistoryItemModel? itemModel)

src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -676,17 +676,10 @@ public async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem p
676676

677677
private async Task LoadFlyoutItemIconAsync(MenuFlyoutItem flyoutItem, string path)
678678
{
679-
var result = await FileThumbnailHelper.GetIconAsync(
680-
path,
681-
Constants.ShellIconSizes.Small,
682-
true,
683-
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
679+
var imageSource = await NavigationHelpers.GetIconForPathAsync(path);
684680

685-
if (result is not null)
686-
{
687-
var imageSource = await result.ToBitmapAsync();
681+
if (imageSource is not null)
688682
flyoutItem.Icon = new ImageIcon { Source = imageSource };
689-
}
690683
}
691684

692685

0 commit comments

Comments
 (0)