mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-22 02:45:00 +00:00
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:
parent
f9f44ae9cb
commit
6729d4e896
5 changed files with 98 additions and 35 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue