Skip to content

Commit 5f35984

Browse files
authored
Feature: Improve tab icon resolution (#13431)
1 parent 8446da2 commit 5f35984

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Files.App/ViewModels/MainPageViewModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ public async Task UpdateTabInfo(Files.App.UserControls.TabBar.TabBarItem tabItem
213213
else if (currentPath.Equals(Constants.UserEnvironmentPaths.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
214214
{
215215
tabLocationHeader = "RecycleBin".GetLocalizedResource();
216+
217+
// Use 48 for higher resolution, the other items look fine with 16.
218+
var iconData = await FileThumbnailHelper.LoadIconFromPathAsync(currentPath, 48u, Windows.Storage.FileProperties.ThumbnailMode.ListView, Windows.Storage.FileProperties.ThumbnailOptions.UseCurrentScale, true);
219+
if (iconData is not null)
220+
iconSource.ImageSource = await iconData.ToBitmapAsync();
216221
}
217222
else if (currentPath.Equals(Constants.UserEnvironmentPaths.MyComputerPath, StringComparison.OrdinalIgnoreCase))
218223
{
@@ -264,7 +269,7 @@ public async Task UpdateTabInfo(Files.App.UserControls.TabBar.TabBarItem tabItem
264269

265270
if (iconSource.ImageSource is null)
266271
{
267-
var iconData = await FileThumbnailHelper.LoadIconFromPathAsync(currentPath, 24u, Windows.Storage.FileProperties.ThumbnailMode.ListView, Windows.Storage.FileProperties.ThumbnailOptions.ResizeThumbnail, true);
272+
var iconData = await FileThumbnailHelper.LoadIconFromPathAsync(currentPath, 16u, Windows.Storage.FileProperties.ThumbnailMode.ListView, Windows.Storage.FileProperties.ThumbnailOptions.UseCurrentScale, true);
268273
if (iconData is not null)
269274
iconSource.ImageSource = await iconData.ToBitmapAsync();
270275
}

0 commit comments

Comments
 (0)