mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-26 11:51:17 +08:00
refactor: use DataGrid instead of ListBox displaying history commits
Sometimes, `Grid.IsSharedSizeScope` does not work when navigating to the first commit Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -300,7 +300,7 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public ContextMenu MakeContextMenu(ListBox list)
|
||||
public ContextMenu MakeContextMenu(DataGrid list)
|
||||
{
|
||||
var current = _repo.CurrentBranch;
|
||||
if (current == null || list.SelectedItems == null)
|
||||
|
||||
@@ -41,12 +41,6 @@ namespace SourceGit.ViewModels
|
||||
set => SetProperty(ref _repositorySidebarWidth, value);
|
||||
}
|
||||
|
||||
public GridLength HistoriesAuthorColumnWidth
|
||||
{
|
||||
get => _historiesAuthorColumnWidth;
|
||||
set => SetProperty(ref _historiesAuthorColumnWidth, value);
|
||||
}
|
||||
|
||||
public GridLength WorkingCopyLeftWidth
|
||||
{
|
||||
get => _workingCopyLeftWidth;
|
||||
@@ -72,7 +66,6 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
|
||||
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 _stashesLeftWidth = new GridLength(300, GridUnitType.Pixel);
|
||||
private GridLength _commitDetailChangesLeftWidth = new GridLength(256, GridUnitType.Pixel);
|
||||
|
||||
@@ -871,7 +871,7 @@ namespace SourceGit.ViewModels
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
List<Models.Commit> visible = [];
|
||||
var visible = new List<Models.Commit>();
|
||||
var method = (Models.CommitSearchMethod)_searchCommitFilterType;
|
||||
|
||||
if (method == Models.CommitSearchMethod.BySHA)
|
||||
@@ -880,8 +880,8 @@ namespace SourceGit.ViewModels
|
||||
if (isCommitSHA)
|
||||
{
|
||||
var commit = new Commands.QuerySingleCommit(_fullpath, _searchCommitFilter).Result();
|
||||
visible = [commit];
|
||||
}
|
||||
visible.Add(commit);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user