enhance: remember the width of author name column in histories view (#425)

This commit is contained in:
leo 2024-08-29 10:17:22 +08:00
parent c22ba75780
commit d794a61196
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View file

@ -30,6 +30,12 @@ namespace SourceGit.ViewModels
set => SetProperty(ref _repositorySidebarWidth, value); set => SetProperty(ref _repositorySidebarWidth, value);
} }
public GridLength HistoriesAuthorColumnWidth
{
get => _historiesAuthorColumnWidth;
set => SetProperty(ref _historiesAuthorColumnWidth, value);
}
public GridLength WorkingCopyLeftWidth public GridLength WorkingCopyLeftWidth
{ {
get => _workingCopyLeftWidth; get => _workingCopyLeftWidth;
@ -55,6 +61,7 @@ namespace SourceGit.ViewModels
} }
private GridLength _repositorySidebarWidth = new GridLength(250, GridUnitType.Pixel); private GridLength _repositorySidebarWidth = new GridLength(250, GridUnitType.Pixel);
private GridLength _historiesAuthorColumnWidth = new GridLength(120, GridUnitType.Pixel);
private GridLength _workingCopyLeftWidth = new GridLength(300, GridUnitType.Pixel); private GridLength _workingCopyLeftWidth = new GridLength(300, GridUnitType.Pixel);
private GridLength _stashesLeftWidth = new GridLength(300, GridUnitType.Pixel); private GridLength _stashesLeftWidth = new GridLength(300, GridUnitType.Pixel);
private GridLength _commitDetailChangesLeftWidth = new GridLength(256, GridUnitType.Pixel); private GridLength _commitDetailChangesLeftWidth = new GridLength(256, GridUnitType.Pixel);

View file

@ -609,6 +609,7 @@
<ContentControl.DataTemplates> <ContentControl.DataTemplates>
<DataTemplate DataType="vm:Histories"> <DataTemplate DataType="vm:Histories">
<v:Histories CurrentBranch="{Binding Repo.CurrentBranch}" <v:Histories CurrentBranch="{Binding Repo.CurrentBranch}"
AuthorNameColumnWidth="{Binding Source={x:Static vm:Preference.Instance}, Path=Layout.HistoriesAuthorColumnWidth, Mode=TwoWay}"
IssueTrackerRules="{Binding Repo.Settings.IssueTrackerRules}" IssueTrackerRules="{Binding Repo.Settings.IssueTrackerRules}"
NavigationId="{Binding NavigationId}"/> NavigationId="{Binding NavigationId}"/>
</DataTemplate> </DataTemplate>