enhance: highlight selected search commits

This commit is contained in:
leo 2024-10-11 11:04:27 +08:00
parent c2b17ef9d0
commit b5000f920f
No known key found for this signature in database
2 changed files with 5 additions and 7 deletions

View file

@ -153,7 +153,11 @@ namespace SourceGit.ViewModels
else if (commits.Count == 1) else if (commits.Count == 1)
{ {
var commit = commits[0] as Models.Commit; var commit = commits[0] as Models.Commit;
_repo.SearchResultSelectedCommit = commit;
if (_repo.SearchResultSelectedCommit == null || _repo.SearchResultSelectedCommit.SHA != commit.SHA)
{
_repo.SearchResultSelectedCommit = _repo.SearchedCommits.Find(x => x.SHA == commit.SHA);
}
AutoSelectedCommit = commit; AutoSelectedCommit = commit;
NavigationId = _navigationId + 1; NavigationId = _navigationId + 1;

View file

@ -460,12 +460,6 @@
<Setter Property="Padding" Value="0"/> <Setter Property="Padding" Value="0"/>
<Setter Property="Height" Value="50"/> <Setter Property="Height" Value="50"/>
</Style> </Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}" />
</Style>
</ListBox.Styles> </ListBox.Styles>
<ListBox.ItemsPanel> <ListBox.ItemsPanel>