Skip to content

Fix: Fixed issue where widths of Git columns were not set correctly #12732

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
merged 1 commit into from
Jun 26, 2023
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
22 changes: 21 additions & 1 deletion src/Files.App/Data/Models/ColumnsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public ColumnViewModel SizeColumn
[LiteDB.BsonIgnore]
public double TotalWidth =>
IconColumn.Length.Value +
GitStatusColumn.Length.Value +
GitLastCommitDateColumn.Length.Value +
GitLastCommitMessageColumn.Length.Value +
GitCommitAuthorColumn.Length.Value +
GitLastCommitShaColumn.Length.Value +
TagColumn.Length.Value +
NameColumn.Length.Value +
DateModifiedColumn.Length.Value +
Expand Down Expand Up @@ -160,6 +165,11 @@ public void SetDesiredSize(double width)
private void SetColumnSizeProportionally(double factor)
{
NameColumn.TryMultiplySize(factor);
GitStatusColumn.TryMultiplySize(factor);
GitLastCommitDateColumn.TryMultiplySize(factor);
GitLastCommitMessageColumn.TryMultiplySize(factor);
GitCommitAuthorColumn.TryMultiplySize(factor);
GitLastCommitShaColumn.TryMultiplySize(factor);
TagColumn.TryMultiplySize(factor);
DateModifiedColumn.TryMultiplySize(factor);
OriginalPathColumn.TryMultiplySize(factor);
Expand Down Expand Up @@ -189,7 +199,12 @@ public override bool Equals(object? obj)
model.OriginalPathColumn.Equals(OriginalPathColumn) &&
model.SizeColumn.Equals(SizeColumn) &&
model.StatusColumn.Equals(StatusColumn) &&
model.TagColumn.Equals(TagColumn);
model.TagColumn.Equals(TagColumn) &&
model.GitStatusColumn.Equals(GitStatusColumn) &&
model.GitLastCommitDateColumn.Equals(GitLastCommitDateColumn) &&
model.GitLastCommitMessageColumn.Equals(GitLastCommitMessageColumn) &&
model.GitCommitAuthorColumn.Equals(GitCommitAuthorColumn) &&
model.GitLastCommitShaColumn.Equals(GitLastCommitShaColumn);
}

return base.Equals(obj);
Expand All @@ -206,6 +221,11 @@ public override int GetHashCode()
hashCode = (hashCode * 397) ^ SizeColumn.GetHashCode();
hashCode = (hashCode * 397) ^ StatusColumn.GetHashCode();
hashCode = (hashCode * 397) ^ TagColumn.GetHashCode();
hashCode = (hashCode * 397) ^ GitStatusColumn.GetHashCode();
hashCode = (hashCode * 397) ^ GitLastCommitDateColumn.GetHashCode();
hashCode = (hashCode * 397) ^ GitLastCommitMessageColumn.GetHashCode();
hashCode = (hashCode * 397) ^ GitCommitAuthorColumn.GetHashCode();
hashCode = (hashCode * 397) ^ GitLastCommitShaColumn.GetHashCode();

return hashCode;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Files.App/Helpers/LayoutPreferences/LayoutPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public LayoutPreferences()
ColumnsViewModel.DateCreatedColumn.UserLengthPixels = UserSettingsService.FoldersSettingsService.DateCreatedColumnWidth;
ColumnsViewModel.ItemTypeColumn.UserLengthPixels = UserSettingsService.FoldersSettingsService.TypeColumnWidth;
ColumnsViewModel.SizeColumn.UserLengthPixels = UserSettingsService.FoldersSettingsService.SizeColumnWidth;
ColumnsViewModel.GitStatusColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.SizeColumnWidth;
ColumnsViewModel.GitLastCommitDateColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.SizeColumnWidth;
ColumnsViewModel.GitLastCommitMessageColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.SizeColumnWidth;
ColumnsViewModel.GitCommitAuthorColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.SizeColumnWidth;
ColumnsViewModel.GitLastCommitShaColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.SizeColumnWidth;
ColumnsViewModel.GitStatusColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.GitStatusColumnWidth;
ColumnsViewModel.GitLastCommitDateColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.GitLastCommitDateColumnWidth;
ColumnsViewModel.GitLastCommitMessageColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.GitLastCommitMessageColumnWidth;
ColumnsViewModel.GitCommitAuthorColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.GitCommitAuthorColumnWidth;
ColumnsViewModel.GitLastCommitShaColumn.UserLengthPixels= UserSettingsService.FoldersSettingsService.GitLastCommitShaColumnWidth;
ColumnsViewModel.TagColumn.UserLengthPixels = UserSettingsService.FoldersSettingsService.TagColumnWidth;
ColumnsViewModel.DateDeletedColumn.UserLengthPixels = UserSettingsService.FoldersSettingsService.DateDeletedColumnWidth;
ColumnsViewModel.OriginalPathColumn.UserLengthPixels = UserSettingsService.FoldersSettingsService.OriginalPathColumnWidth;
Expand Down
10 changes: 10 additions & 0 deletions src/Files.App/Services/Settings/FoldersSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ protected override void RaiseOnSettingChangedEvent(object sender, SettingChanged
{
case nameof(SyncFolderPreferencesAcrossDirectories):
case nameof(DefaultLayoutMode):
case nameof(GitStatusColumnWidth):
case nameof(GitLastCommitDateColumnWidth):
case nameof(GitLastCommitMessageColumnWidth):
case nameof(GitCommitAuthorColumnWidth):
case nameof(GitLastCommitShaColumnWidth):
case nameof(TagColumnWidth):
case nameof(NameColumnWidth):
case nameof(DateModifiedColumnWidth):
Expand All @@ -383,6 +388,11 @@ protected override void RaiseOnSettingChangedEvent(object sender, SettingChanged
case nameof(ShowDateCreatedColumn):
case nameof(ShowTypeColumn):
case nameof(ShowSizeColumn):
case nameof(ShowGitStatusColumn):
case nameof(ShowGitLastCommitDateColumn):
case nameof(ShowGitLastCommitMessageColumn):
case nameof(ShowGitCommitAuthorColumn):
case nameof(ShowGitLastCommitShaColumn):
case nameof(ShowFileTagColumn):
case nameof(ShowHiddenItems):
case nameof(ShowProtectedSystemFiles):
Expand Down