mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 22:01:10 +08:00
enhance: make sure mouse is hover commit row (not empty area or headers in DataGrid) when trying to open context menu
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -199,11 +199,14 @@ namespace SourceGit.Views
|
||||
|
||||
private void OnCommitListContextRequested(object sender, ContextRequestedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Histories histories && sender is DataGrid { SelectedItems.Count: > 0 } dataGrid)
|
||||
if (DataContext is ViewModels.Histories histories &&
|
||||
sender is DataGrid { SelectedItems.Count: > 0 } dataGrid &&
|
||||
e.Source is Control { DataContext: Models.Commit })
|
||||
{
|
||||
var menu = histories.MakeContextMenu(dataGrid);
|
||||
menu?.Open(dataGrid);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user