mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 21:24:59 +00:00
feature: double-click on single-selecte change tree or file tree will expand/collapse folder node
This commit is contained in:
parent
cce4e5348c
commit
9d13b17aaf
8 changed files with 70 additions and 12 deletions
|
@ -511,14 +511,22 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
};
|
||||
|
||||
source.Selection = new Models.TreeDataGridSelectionModel<FileTreeNode>(source, x => x.Children);
|
||||
source.RowSelection.SingleSelect = true;
|
||||
source.RowSelection.SelectionChanged += (s, _) =>
|
||||
var selection = new Models.TreeDataGridSelectionModel<FileTreeNode>(source, x => x.Children);
|
||||
selection.SingleSelect = true;
|
||||
selection.RowDoubleTapped += (s, e) =>
|
||||
{
|
||||
var model = s as Models.TreeDataGridSelectionModel<FileTreeNode>;
|
||||
var node = model.SelectedItem;
|
||||
if (node != null && node.IsFolder)
|
||||
node.IsExpanded = !node.IsExpanded;
|
||||
};
|
||||
selection.SelectionChanged += (s, _) =>
|
||||
{
|
||||
if (s is Models.TreeDataGridSelectionModel<FileTreeNode> selection)
|
||||
RefreshViewRevisionFile(selection.SelectedItem?.Backend as Models.Object);
|
||||
};
|
||||
|
||||
source.Selection = selection;
|
||||
RevisionFiles = source;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue