Skip to content

Commit b5000f9

Browse files
committed
enhance: highlight selected search commits
1 parent c2b17ef commit b5000f9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/ViewModels/Histories.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ public void Select(IList commits)
153153
else if (commits.Count == 1)
154154
{
155155
var commit = commits[0] as Models.Commit;
156-
_repo.SearchResultSelectedCommit = commit;
156+
157+
if (_repo.SearchResultSelectedCommit == null || _repo.SearchResultSelectedCommit.SHA != commit.SHA)
158+
{
159+
_repo.SearchResultSelectedCommit = _repo.SearchedCommits.Find(x => x.SHA == commit.SHA);
160+
}
157161

158162
AutoSelectedCommit = commit;
159163
NavigationId = _navigationId + 1;

src/Views/Repository.axaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,6 @@
460460
<Setter Property="Padding" Value="0"/>
461461
<Setter Property="Height" Value="50"/>
462462
</Style>
463-
<Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
464-
<Setter Property="Background" Value="Transparent" />
465-
</Style>
466-
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
467-
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}" />
468-
</Style>
469463
</ListBox.Styles>
470464

471465
<ListBox.ItemsPanel>

0 commit comments

Comments
 (0)