diff --git a/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs b/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs index 7b0af4364acb..fa25561d4737 100644 --- a/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs +++ b/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs @@ -103,17 +103,17 @@ public static int GetColumnsViewRowHeight(ColumnsViewSizeKind columnsViewSizeKin switch (columnsViewSizeKind) { case ColumnsViewSizeKind.Compact: - return 28; + return 24; case ColumnsViewSizeKind.Small: - return 36; + return 32; case ColumnsViewSizeKind.Medium: - return 40; + return 36; case ColumnsViewSizeKind.Large: - return 44; + return 40; case ColumnsViewSizeKind.ExtraLarge: - return 48; + return 44; default: - return 36; + return 32; } } diff --git a/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml b/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml index 9e08d44e7391..e4c52f8e63bf 100644 --- a/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml +++ b/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml @@ -206,6 +206,7 @@ ()!; - presenter!.Background = new SolidColorBrush(Microsoft.UI.Colors.Transparent); + SetFolderBackground(openedFolderPresenter, new SolidColorBrush(Microsoft.UI.Colors.Transparent)); openedFolderPresenter = null; } @@ -157,8 +156,8 @@ private void HighlightPathDirectory(ListViewBase sender, ContainerContentChangin if (args.Item is ListedItem item && columnsOwner?.OwnerPath is string ownerPath && (ownerPath == item.ItemPath || ownerPath.StartsWith(item.ItemPath) && ownerPath[item.ItemPath.Length] is '/' or '\\')) { - var presenter = args.ItemContainer.FindDescendant()!; - presenter!.Background = this.Resources["ListViewItemBackgroundSelected"] as SolidColorBrush; + SetFolderBackground(args.ItemContainer as ListViewItem, this.Resources["ListViewItemBackgroundSelected"] as SolidColorBrush); + openedFolderPresenter = FileList.ContainerFromItem(item) as ListViewItem; FileList.ContainerContentChanging -= HighlightPathDirectory; } @@ -279,8 +278,7 @@ protected override void FileList_SelectionChanged(object sender, SelectionChange if (e.RemovedItems.Count > 0 && openedFolderPresenter != null) { - var presenter = openedFolderPresenter.FindDescendant()!; - presenter!.Background = this.Resources["ListViewItemBackgroundSelected"] as SolidColorBrush; + SetFolderBackground(openedFolderPresenter, this.Resources["ListViewItemBackgroundSelected"] as SolidColorBrush); } if (SelectedItems?.Count == 1 && SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder) @@ -592,5 +590,16 @@ internal void ClearSelectionIndicator() FileList.SelectedItem = null; LockPreviewPaneContent = false; } + + private static void SetFolderBackground(ListViewItem? lvi, SolidColorBrush? backgroundColor) + { + if (lvi == null || backgroundColor == null) return; + + + if (lvi.FindDescendant() is Grid presenter) + { + presenter.Background = backgroundColor; + } + } } }