feature: supports to ignore new files in folder from context menu of selected folder node in change tree (#1432)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-18 22:10:23 +08:00
parent f9f44ae9cb
commit 6729d4e896
No known key found for this signature in database
5 changed files with 98 additions and 35 deletions

View file

@ -1,6 +1,7 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.VisualTree;
namespace SourceGit.Views
{
@ -29,7 +30,12 @@ namespace SourceGit.Views
{
if (DataContext is ViewModels.WorkingCopy vm && sender is Control control)
{
var menu = vm.CreateContextMenuForUnstagedChanges();
var container = control.FindDescendantOfType<ChangeCollectionContainer>();
var selectedSingleFolder = string.Empty;
if (container is { SelectedItems: { Count: 1 }, SelectedItem: ViewModels.ChangeTreeNode { IsFolder: true } node })
selectedSingleFolder = node.FullPath;
var menu = vm.CreateContextMenuForUnstagedChanges(selectedSingleFolder);
menu?.Open(control);
e.Handled = true;
}