Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 committed Feb 23, 2024
1 parent eb06ec2 commit 3dd6264
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 22 deletions.
12 changes: 12 additions & 0 deletions src/Files.App/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ public static class Appearance
public const string StandardFont = "Segoe UI Variable";
}

// Default icon sizes that are available for files and folders
public static class ShellIconSizes
{
public const int Small = 16;

public const int Large = 32;

public const int ExtraLarge = 48;

public const int Jumbo = 256;
}

public static class Widgets
{
public static class Drives
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Items/DriveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public async Task LoadThumbnailAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
DeviceID,
(int)LayoutItemIconSizeKind.Small,
Constants.ShellIconSizes.Small,
false,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Items/SidebarLibraryItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task LoadLibraryIconAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
Path,
(int)LayoutItemIconSizeKind.Small,
Constants.ShellIconSizes.Small,
false,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Items/WidgetDriveCardItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task LoadCardThumbnailAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
Item.Path,
(int)LayoutItemIconSizeKind.Large,
Constants.ShellIconSizes.Large,
true,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Items/WidgetFolderCardItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task LoadCardThumbnailAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
Path,
(int)LayoutItemIconSizeKind.Large,
Constants.ShellIconSizes.Large,
true,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Models/ItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ await SafetyExtensions.IgnoreExceptions(() =>
{
var headerIconInfo = await FileThumbnailHelper.GetIconAsync(
item.ItemPath,
(int)LayoutItemIconSizeKind.Large,
Constants.ShellIconSizes.Large,
false,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Models/SidebarPinnedModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task<LocationItem> CreateLocationItemFromPathAsync(string path)
{
var result = await FileThumbnailHelper.GetIconAsync(
res.Result.Path,
(int)LayoutItemIconSizeKind.Small,
Constants.ShellIconSizes.Small,
true,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
6 changes: 3 additions & 3 deletions src/Files.App/Helpers/Layout/LayoutPreferencesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ public uint GetRoundedIconSize()
return LayoutMode switch
{
FolderLayoutModes.DetailsView
=> (int)LayoutItemIconSizeKind.Large,
=> Constants.ShellIconSizes.Large,
FolderLayoutModes.ListView
=> (int)LayoutItemIconSizeKind.Large,
=> Constants.ShellIconSizes.Large,
FolderLayoutModes.ColumnView
=> (int)LayoutItemIconSizeKind.Large,
=> Constants.ShellIconSizes.Large,
_ when LayoutMode == FolderLayoutModes.GridView && UserSettingsService.LayoutSettingsService.ItemSizeGridView <= GridViewSizeKind.Small ||
LayoutMode == FolderLayoutModes.TilesView
=> 96,
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Helpers/Navigation/NavigationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private static async Task UpdateTabInfoAsync(TabBarItem tabItem, object navigati
{
var result = await FileThumbnailHelper.GetIconAsync(
currentPath,
(int)LayoutItemIconSizeKind.Small,
Constants.ShellIconSizes.Small,
true,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Utils/Cloud/CloudDrivesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static async Task UpdateDrivesAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
provider.SyncFolder,
(int)LayoutItemIconSizeKind.Small,
Constants.ShellIconSizes.Small,
false,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Utils/RecentItem/RecentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task LoadRecentItemIconAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
RecentPath,
(int)LayoutItemIconSizeKind.Small,
Constants.ShellIconSizes.Small,
false,
false,
IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Utils/Storage/Search/FolderSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ private async Task<ListedItem> GetListedItemAsync(IStorageItem item)
{
var iconResult = await FileThumbnailHelper.GetIconAsync(
item.Path,
(int)LayoutItemIconSizeKind.Small,
Constants.ShellIconSizes.Small,
item.IsOfType(StorageItemTypes.Folder),
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/ViewModels/Properties/BasePropertiesPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)

var result = await FileThumbnailHelper.GetIconAsync(
file.Path,
(int)LayoutItemIconSizeKind.ExtraLarge,
Constants.ShellIconSizes.ExtraLarge,
false,
false,
IconOptions.UseCurrentScale);
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/ViewModels/Properties/Items/DriveProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async override Task GetSpecialPropertiesAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
Drive.Path,
(int)LayoutItemIconSizeKind.ExtraLarge,
Constants.ShellIconSizes.ExtraLarge,
true,
false,
IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale);
Expand All @@ -63,7 +63,7 @@ public async override Task GetSpecialPropertiesAsync()
{
result = await FileThumbnailHelper.GetIconAsync(
Drive.DeviceID,
(int)LayoutItemIconSizeKind.ExtraLarge,
Constants.ShellIconSizes.ExtraLarge,
true, false, IconOptions.ReturnIconOnly | IconOptions.UseCurrentScale); // For network shortcuts

ViewModel.IconData = result.IconData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public override async Task GetSpecialPropertiesAsync()

var result = await FileThumbnailHelper.GetIconAsync(
Item.ItemPath,
(int)LayoutItemIconSizeKind.ExtraLarge,
Constants.ShellIconSizes.ExtraLarge,
false,
false,
IconOptions.UseCurrentScale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public async override Task GetSpecialPropertiesAsync()

var result = await FileThumbnailHelper.GetIconAsync(
Item.ItemPath,
(int)LayoutItemIconSizeKind.ExtraLarge,
Constants.ShellIconSizes.ExtraLarge,
true,
false,
IconOptions.UseCurrentScale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async override Task GetSpecialPropertiesAsync()

var result = await FileThumbnailHelper.GetIconAsync(
Library.ItemPath,
(int)LayoutItemIconSizeKind.ExtraLarge,
Constants.ShellIconSizes.ExtraLarge,
true,
false,
IconOptions.UseCurrentScale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public async virtual Task<List<FileProperty>> LoadPreviewAndDetailsAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
Item.ItemPath,
(int)LayoutItemIconSizeKind.Jumbo,
Constants.ShellIconSizes.Jumbo,
false,
false,
IconOptions.None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private async Task LoadPreviewAndDetailsAsync()
// Requesting sizes larger than 220 may result in a thumbnail with a small folder
var result = await FileThumbnailHelper.GetIconAsync(
Item.ItemPath,
(int)LayoutItemIconSizeKind.Jumbo,
Constants.ShellIconSizes.Jumbo,
true,
false,
IconOptions.None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private async Task LoadItemThumbnailAsync()
{
var result = await FileThumbnailHelper.GetIconAsync(
Item.ItemPath,
(int)LayoutItemIconSizeKind.Jumbo,
Constants.ShellIconSizes.Jumbo,
false,
false,
IconOptions.None);
Expand Down

0 comments on commit 3dd6264

Please sign in to comment.