Skip to content

Feature: Improve tab icon resolution #13431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Files.App/ViewModels/MainPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ public async Task UpdateTabInfo(Files.App.UserControls.TabBar.TabBarItem tabItem
else if (currentPath.Equals(Constants.UserEnvironmentPaths.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
{
tabLocationHeader = "RecycleBin".GetLocalizedResource();

// Use 48 for higher resolution, the other items look fine with 16.
var iconData = await FileThumbnailHelper.LoadIconFromPathAsync(currentPath, 48u, Windows.Storage.FileProperties.ThumbnailMode.ListView, Windows.Storage.FileProperties.ThumbnailOptions.UseCurrentScale, true);
if (iconData is not null)
iconSource.ImageSource = await iconData.ToBitmapAsync();
}
else if (currentPath.Equals(Constants.UserEnvironmentPaths.MyComputerPath, StringComparison.OrdinalIgnoreCase))
{
Expand Down Expand Up @@ -264,7 +269,7 @@ public async Task UpdateTabInfo(Files.App.UserControls.TabBar.TabBarItem tabItem

if (iconSource.ImageSource is null)
{
var iconData = await FileThumbnailHelper.LoadIconFromPathAsync(currentPath, 24u, Windows.Storage.FileProperties.ThumbnailMode.ListView, Windows.Storage.FileProperties.ThumbnailOptions.ResizeThumbnail, true);
var iconData = await FileThumbnailHelper.LoadIconFromPathAsync(currentPath, 16u, Windows.Storage.FileProperties.ThumbnailMode.ListView, Windows.Storage.FileProperties.ThumbnailOptions.UseCurrentScale, true);
if (iconData is not null)
iconSource.ImageSource = await iconData.ToBitmapAsync();
}
Expand Down