Repository: files-community/Files
File: src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs (C#)

Code before:
		/// <returns></returns>
		public static int GetListViewRowHeight(ListViewSizeKind listViewSizeKind)
		{
			switch (listViewSizeKind)
			{
				case ListViewSizeKind.Compact:
					return 24;
				case ListViewSizeKind.Small:
					return 32;
				case ListViewSizeKind.Medium:
					return 36;
				case ListViewSizeKind.Large:
					return 40;
				case ListViewSizeKind.ExtraLarge:
					return 44;
				default:
					return 32;
			}
		}

		/// <summary>
		/// Gets the desired icon size for specified layout
		/// </summary>
		/// <param name="listViewSizeKind"></param>
		/// <returns></returns>
		public static uint GetIconSize(FolderLayoutModes folderLayoutMode)
		{
			return folderLayoutMode switch
			{
				// Details
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact => Constants.ShellIconSizes.Small,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Small => Constants.ShellIconSizes.Small,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Medium => 20,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Large => 24,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.ExtraLarge => Constants.ShellIconSizes.Large,

				// List
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact => Constants.ShellIconSizes.Small,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Small => Constants.ShellIconSizes.Small,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Medium => 20,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Large => 24,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.ExtraLarge => Constants.ShellIconSizes.Large,

				// Columns
				FolderLayoutModes.ColumnView => Constants.ShellIconSizes.Large,

				// Grid and Tiles
				FolderLayoutModes.GridView when LayoutSettingsService.GridViewSize <= GridViewSizeKind.Small => 96,
				FolderLayoutModes.TilesView => 96,
				FolderLayoutModes.GridView when LayoutSettingsService.GridViewSize <= GridViewSizeKind.Large => 128,


Review comment (suggestion):
This is based on the earlier version in `LayoutPreferencesManager.cs` but has been modified to return the proper icon sizes for the Details and List View.

Code after:
		/// <returns></returns>
		public static int GetListViewRowHeight(ListViewSizeKind listViewSizeKind)
		{
			switch (listViewSizeKind)
			{
				case ListViewSizeKind.Compact:
					return 24;
				case ListViewSizeKind.Small:
					return 32;
				case ListViewSizeKind.Medium:
					return 36;
				case ListViewSizeKind.Large:
					return 40;
				case ListViewSizeKind.ExtraLarge:
					return 44;
				default:
					return 32;
			}
		}

		/// <summary>
		/// Gets the desired icon size for the requested layout
		/// </summary>
		/// <param name="folderLayoutMode"></param>
		/// <returns></returns>
		public static uint GetIconSize(FolderLayoutModes folderLayoutMode)
		{
			return folderLayoutMode switch
			{
				// Details
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact => Constants.ShellIconSizes.Small,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Small => Constants.ShellIconSizes.Small,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Medium => 20,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Large => 24,
				FolderLayoutModes.DetailsView when LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.ExtraLarge => Constants.ShellIconSizes.Large,

				// List
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact => Constants.ShellIconSizes.Small,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Small => Constants.ShellIconSizes.Small,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Medium => 20,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.Large => 24,
				FolderLayoutModes.ListView when LayoutSettingsService.ListViewSize == ListViewSizeKind.ExtraLarge => Constants.ShellIconSizes.Large,

				// Columns
				FolderLayoutModes.ColumnView => Constants.ShellIconSizes.Large,

				// Grid and Tiles
				FolderLayoutModes.GridView when LayoutSettingsService.GridViewSize <= GridViewSizeKind.Small => 96,
				FolderLayoutModes.GridView when LayoutSettingsService.GridViewSize <= GridViewSizeKind.Large => 128,
				FolderLayoutModes.TilesView => 96,