feature: double-click on single-selecte change tree or file tree will expand/collapse folder node

This commit is contained in:
leo 2024-05-29 20:48:51 +08:00
parent cce4e5348c
commit 9d13b17aaf
8 changed files with 70 additions and 12 deletions

View file

@ -171,22 +171,27 @@ namespace SourceGit.Models
if (!IsSelected(modelIndex))
{
PointerSelect(sender, row, e);
_pressedPoint = s_InvalidPoint;
}
else
{
var point = e.GetCurrentPoint(sender);
if (point.Properties.IsRightButtonPressed)
{
_pressedPoint = s_InvalidPoint;
return;
}
if (e.KeyModifiers == KeyModifiers.Control)
{
Deselect(modelIndex);
}
else if (e.ClickCount == 2)
else if (e.ClickCount % 2 == 0)
{
_rowDoubleTapped?.Invoke(this, e);
e.Handled = true;
}
else
else if (sender.RowSelection.Count > 1)
{
using (BatchUpdate())
{
@ -194,9 +199,9 @@ namespace SourceGit.Models
Select(modelIndex);
}
}
_pressedPoint = s_InvalidPoint;
}
_pressedPoint = s_InvalidPoint;
}
else
{