Browse Source

DataGrid selection refactoring (#13848)

pull/13893/head
Lubomir Tetak 3 years ago
committed by GitHub
parent
commit
9654471806
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/Avalonia.Controls.DataGrid/DataGrid.cs
  2. 2
      src/Avalonia.Controls.DataGrid/DataGridCell.cs
  3. 8
      src/Avalonia.Controls.DataGrid/DataGridRow.cs
  4. 1
      src/Avalonia.Controls.DataGrid/DataGridRowHeader.cs

6
src/Avalonia.Controls.DataGrid/DataGrid.cs

@ -1828,12 +1828,6 @@ namespace Avalonia.Controls
private set; private set;
} }
internal bool UpdatedStateOnMouseLeftButtonDown
{
get;
set;
}
/// <summary> /// <summary>
/// Indicates whether or not to use star-sizing logic. If the DataGrid has infinite available space, /// Indicates whether or not to use star-sizing logic. If the DataGrid has infinite available space,
/// then star sizing doesn't make sense. In this case, all star columns grow to a predefined size of /// then star sizing doesn't make sense. In this case, all star columns grow to a predefined size of

2
src/Avalonia.Controls.DataGrid/DataGridCell.cs

@ -189,8 +189,6 @@ namespace Avalonia.Controls
{ {
e.Handled = handled; e.Handled = handled;
} }
OwningGrid.UpdatedStateOnMouseLeftButtonDown = true;
} }
} }
else if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed) else if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed)

8
src/Avalonia.Controls.DataGrid/DataGridRow.cs

@ -771,14 +771,6 @@ namespace Avalonia.Controls
if (OwningGrid != null) if (OwningGrid != null)
{ {
OwningGrid.IsDoubleClickRecordsClickOnCall(this); OwningGrid.IsDoubleClickRecordsClickOnCall(this);
if (OwningGrid.UpdatedStateOnMouseLeftButtonDown)
{
OwningGrid.UpdatedStateOnMouseLeftButtonDown = false;
}
else
{
e.Handled = OwningGrid.UpdateStateOnMouseLeftButtonDown(e, -1, Slot, false);
}
} }
} }

1
src/Avalonia.Controls.DataGrid/DataGridRowHeader.cs

@ -195,7 +195,6 @@ namespace Avalonia.Controls.Primitives
Debug.Assert(sender is DataGridRowHeader); Debug.Assert(sender is DataGridRowHeader);
Debug.Assert(sender == this); Debug.Assert(sender == this);
e.Handled = OwningGrid.UpdateStateOnMouseLeftButtonDown(e, -1, Slot, false); e.Handled = OwningGrid.UpdateStateOnMouseLeftButtonDown(e, -1, Slot, false);
OwningGrid.UpdatedStateOnMouseLeftButtonDown = true;
} }
} }
else if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed) else if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed)

Loading…
Cancel
Save