mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-27 05:15:05 +00:00
enhance: allow drag-drop of item (or folder) anywhere in repo-list (#1459)
Dropping on a non-Group item was not allowed earlier, but now it adds/moves the dragged item into the parent Group (possibly Root) of the drop-target item.
This commit is contained in:
parent
d192712f51
commit
743be5491a
2 changed files with 24 additions and 2 deletions
|
@ -215,7 +215,7 @@ namespace SourceGit.Views
|
|||
if (to == null)
|
||||
return;
|
||||
|
||||
e.DragEffects = to.IsRepository ? DragDropEffects.None : DragDropEffects.Move;
|
||||
e.DragEffects = DragDropEffects.Move;
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
@ -226,12 +226,15 @@ namespace SourceGit.Views
|
|||
return;
|
||||
|
||||
var to = grid.DataContext as ViewModels.RepositoryNode;
|
||||
if (to == null || to.IsRepository)
|
||||
if (to == null)
|
||||
{
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (to.IsRepository)
|
||||
to = ViewModels.Welcome.Instance.FindParentGroup(to);
|
||||
|
||||
if (e.Data.Contains("MovedRepositoryTreeNode") &&
|
||||
e.Data.Get("MovedRepositoryTreeNode") is ViewModels.RepositoryNode moved)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue