Skip to content

Fix: Fixed an issue where the name column had a max width #10240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 6 additions & 19 deletions src/Files.App/ViewModels/ColumnsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ public ColumnViewModel TagColumn
set => SetProperty(ref tagColumn, value);
}

private ColumnViewModel nameColumn = new ColumnViewModel();
private ColumnViewModel nameColumn = new ColumnViewModel()
{
NormalMaxLength = 1000d
};

public ColumnViewModel NameColumn
{
Expand Down Expand Up @@ -129,16 +132,12 @@ private void SetColumnSizeProportionally(double factor)
StatusColumn.TryMultiplySize(factor);
}

public override bool Equals(object obj)
public override bool Equals(object? obj)
{
if (obj == null)
{
return false;
}
if (obj == this)
{
return true;
}
if (obj is ColumnsViewModel model)
{
return (
Expand Down Expand Up @@ -225,9 +224,7 @@ public bool UserCollapsed
set
{
if (SetProperty(ref userCollapsed, value))
{
UpdateVisibility();
}
}
}

Expand Down Expand Up @@ -292,33 +289,23 @@ public void TryMultiplySize(double factor)
{
var newSize = Length.Value * factor;
if (newSize == 0)
{
return;
}

double setLength = newSize;
if (newSize < MinLength)
{
setLength = MinLength;
}
else if (newSize >= MaxLength)
{
setLength = MaxLength;
}

UserLength = new GridLength(setLength);
}

public override bool Equals(object obj)
public override bool Equals(object? obj)
{
if (obj == null)
{
return false;
}
if (obj == this)
{
return true;
}
if (obj is ColumnViewModel model)
{
return (
Expand Down
3 changes: 1 addition & 2 deletions src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition
x:Name="Column2"
Width="{x:Bind ColumnsViewModel.NameColumn.Length, Mode=OneWay}"
MaxWidth="{x:Bind ColumnsViewModel.NameColumn.MaxLength, Mode=OneWay}" />
Width="{x:Bind ColumnsViewModel.NameColumn.Length, Mode=OneWay}" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition
x:Name="Column3"
Expand Down