From a5feae407eac84c4bc0cd8b6c0db9fa15de1ab5d Mon Sep 17 00:00:00 2001 From: Filippo Ferrario <102259289+ferrariofilippo@users.noreply.github.com> Date: Tue, 14 Feb 2023 17:49:42 +0100 Subject: [PATCH] Fix: Fixed issue with resizing the status column (#11027) --- src/Files.App/Shell/Win32Shell.cs | 2 +- src/Files.App/ViewModels/ColumnsViewModel.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Files.App/Shell/Win32Shell.cs b/src/Files.App/Shell/Win32Shell.cs index 3d38497be93e..26771c0f0e7e 100644 --- a/src/Files.App/Shell/Win32Shell.cs +++ b/src/Files.App/Shell/Win32Shell.cs @@ -43,7 +43,7 @@ static Win32Shell() if ((controlPanel.PIDL.IsParentOf(shellFolder.PIDL, false) || controlPanelCategoryView.PIDL.IsParentOf(shellFolder.PIDL, false)) && - !shellFolder.Any()) + (shellFolder is null || !shellFolder.Any())) { // Return null to force open unsupported items in explorer // only if inside control panel and folder appears empty diff --git a/src/Files.App/ViewModels/ColumnsViewModel.cs b/src/Files.App/ViewModels/ColumnsViewModel.cs index 04c5ae5c22d4..a68022fdbae9 100644 --- a/src/Files.App/ViewModels/ColumnsViewModel.cs +++ b/src/Files.App/ViewModels/ColumnsViewModel.cs @@ -184,12 +184,11 @@ public bool IsHidden [LiteDB.BsonIgnore] public double MaxLength { - get => IsHidden || UserCollapsed ? 0 : NormalMaxLength; + get => UserCollapsed ? 0 : NormalMaxLength; } private double normalMaxLength = 800; - [LiteDB.BsonIgnore] public double NormalMaxLength { get => normalMaxLength; @@ -212,10 +211,10 @@ public double NormalMinLength } [LiteDB.BsonIgnore] - public double MinLength => IsHidden || UserCollapsed ? 0 : NormalMinLength; + public double MinLength => UserCollapsed ? 0 : NormalMinLength; [LiteDB.BsonIgnore] - public Visibility Visibility => IsHidden || UserCollapsed ? Visibility.Collapsed : Visibility.Visible; + public Visibility Visibility => UserCollapsed ? Visibility.Collapsed : Visibility.Visible; private bool userCollapsed; @@ -232,7 +231,7 @@ public bool UserCollapsed [LiteDB.BsonIgnore] public GridLength Length { - get => IsHidden || UserCollapsed ? new GridLength(0) : UserLength; + get => UserCollapsed ? new GridLength(0) : UserLength; } private const int gridSplitterWidth = 12; @@ -240,7 +239,7 @@ public GridLength Length [LiteDB.BsonIgnore] public GridLength LengthIncludingGridSplitter { - get => IsHidden || UserCollapsed ? new GridLength(0) : new GridLength(UserLength.Value + (IsResizeable ? gridSplitterWidth : 0)); + get => UserCollapsed ? new GridLength(0) : new GridLength(UserLength.Value + (IsResizeable ? gridSplitterWidth : 0)); } [LiteDB.BsonIgnore] @@ -270,12 +269,14 @@ public double UserLengthPixels public void Hide() { + UserCollapsed = true; IsHidden = true; UpdateVisibility(); } public void Show() { + UserCollapsed = false; IsHidden = false; UpdateVisibility(); }