mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04: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
|
@ -1,5 +1,6 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
|
@ -21,6 +22,18 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnChangeDoubleTapped(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ChangeCollectionView view)
|
||||
{
|
||||
var selected = view.tree?.RowSelection?.SelectedItem as ViewModels.FileTreeNode;
|
||||
if (selected != null && selected.IsFolder)
|
||||
selected.IsExpanded = !selected.IsExpanded;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.RevisionCompare vm && sender is TextBlock block)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue