Skip to content

Commit 3cd7dfe

Browse files
committed
feat: 添加对数据网格指针退出事件的支持,更新相关逻辑以处理悬停提交
1 parent 9b01880 commit 3cd7dfe

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Views/Histories.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
LayoutUpdated="OnCommitListLayoutUpdated"
4646
SelectionChanged="OnCommitListSelectionChanged"
4747
PointerMoved="OnDataGridPointerMoved"
48+
PointerExited="OnDataGridPointerExited"
4849
ContextRequested="OnCommitListContextRequested"
4950
DoubleTapped="OnCommitListDoubleTapped"
5051
KeyDown="OnCommitListKeyDown">

src/Views/Histories.axaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ private void OnDataGridPointerMoved(object sender, PointerEventArgs e)
269269
}
270270
}
271271

272+
private void OnDataGridPointerExited(object sender, PointerEventArgs e)
273+
{
274+
var hs = (sender as DataGrid)?.DataContext as ViewModels.Histories;
275+
hs?.ProcessHoveredCommit(hs.LastSelectedCommit);
276+
}
277+
272278
private void OnCommitListContextRequested(object sender, ContextRequestedEventArgs e)
273279
{
274280
if (sender is DataGrid { SelectedItems: { } selected } dataGrid &&

0 commit comments

Comments
 (0)