Skip to content

Commit

Permalink
Fix: Fixed issue with resizing the status column (#11027)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrariofilippo authored Feb 14, 2023
1 parent 958dbec commit a5feae4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Files.App/Shell/Win32Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions src/Files.App/ViewModels/ColumnsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -232,15 +231,15 @@ 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;

[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]
Expand Down Expand Up @@ -270,12 +269,14 @@ public double UserLengthPixels

public void Hide()
{
UserCollapsed = true;
IsHidden = true;
UpdateVisibility();
}

public void Show()
{
UserCollapsed = false;
IsHidden = false;
UpdateVisibility();
}
Expand Down

0 comments on commit a5feae4

Please sign in to comment.