diff --git a/native/Avalonia.Native/src/OSX/window.mm b/native/Avalonia.Native/src/OSX/window.mm
index bd93de0e78..26c065fe11 100644
--- a/native/Avalonia.Native/src/OSX/window.mm
+++ b/native/Avalonia.Native/src/OSX/window.mm
@@ -52,7 +52,6 @@ public:
[Window setBackingType:NSBackingStoreBuffered];
[Window setOpaque:false];
- [Window setContentView: StandardContainer];
}
virtual HRESULT ObtainNSWindowHandle(void** ret) override
@@ -125,6 +124,8 @@ public:
SetPosition(lastPositionSet);
UpdateStyle();
+ [Window setContentView: StandardContainer];
+
[Window setTitle:_lastTitle];
if(ShouldTakeFocusOnShow() && activate)
@@ -323,6 +324,7 @@ public:
BaseEvents->Resized(AvnSize{x,y}, reason);
}
+ [StandardContainer setFrameSize:NSSize{x,y}];
[Window setContentSize:NSSize{x, y}];
}
@finally
diff --git a/packages/Avalonia/AvaloniaBuildTasks.targets b/packages/Avalonia/AvaloniaBuildTasks.targets
index de3830ffea..3f9ccb04eb 100644
--- a/packages/Avalonia/AvaloniaBuildTasks.targets
+++ b/packages/Avalonia/AvaloniaBuildTasks.targets
@@ -54,6 +54,7 @@
+
diff --git a/readme.md b/readme.md
index 7959bc5540..ef8c116728 100644
--- a/readme.md
+++ b/readme.md
@@ -60,6 +60,9 @@ See the [build instructions here](Documentation/build.md).
## Contributing
+This project exists thanks to all the people who contribute.
+
+
Please read the [contribution guidelines](CONTRIBUTING.md) before submitting a pull request.
## Code of Conduct
@@ -71,11 +74,6 @@ For more information see the [.NET Foundation Code of Conduct](https://dotnetfou
Avalonia is licenced under the [MIT licence](licence.md).
-## Contributors
-
-This project exists thanks to all the people who contribute. [[Contribute](https://avaloniaui.net/contributing)].
-
-
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Avalonia#backer)]
diff --git a/samples/ControlCatalog/MainWindow.xaml b/samples/ControlCatalog/MainWindow.xaml
index ee42e7a54b..375345f64e 100644
--- a/samples/ControlCatalog/MainWindow.xaml
+++ b/samples/ControlCatalog/MainWindow.xaml
@@ -63,11 +63,11 @@
diff --git a/samples/ControlCatalog/Pages/ButtonPage.xaml b/samples/ControlCatalog/Pages/ButtonPage.xaml
index be114bbbc9..b35c112a68 100644
--- a/samples/ControlCatalog/Pages/ButtonPage.xaml
+++ b/samples/ControlCatalog/Pages/ButtonPage.xaml
@@ -10,7 +10,7 @@
HorizontalAlignment="Center"
Spacing="16">
-
+
diff --git a/samples/ControlCatalog/Pages/CheckBoxPage.xaml b/samples/ControlCatalog/Pages/CheckBoxPage.xaml
index 1359cfa2ef..769ef26699 100644
--- a/samples/ControlCatalog/Pages/CheckBoxPage.xaml
+++ b/samples/ControlCatalog/Pages/CheckBoxPage.xaml
@@ -11,9 +11,9 @@
Spacing="16">
- Unchecked
- Checked
- Indeterminate
+ _Unchecked
+ _Checked
+ _Indeterminate
Disabled
Use filters
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml
index 392ccb57c3..4d0bd663df 100644
--- a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml
+++ b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml
@@ -1,17 +1,33 @@
+
+
+
+
+
+
-
-
diff --git a/samples/ControlCatalog/Pages/ListBoxPage.xaml b/samples/ControlCatalog/Pages/ListBoxPage.xaml
index f515db84d4..b36629fb2a 100644
--- a/samples/ControlCatalog/Pages/ListBoxPage.xaml
+++ b/samples/ControlCatalog/Pages/ListBoxPage.xaml
@@ -2,9 +2,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ControlCatalog.Pages.ListBoxPage">
+
+
+
+
ListBox
Hosts a collection of ListBoxItem.
+ Each 5th item is highlighted with nth-child(5n+3) and nth-last-child(5n+4) rules.
Multiple
diff --git a/samples/ControlCatalog/Pages/RadioButtonPage.xaml b/samples/ControlCatalog/Pages/RadioButtonPage.xaml
index bf31c40e2a..408f9c2411 100644
--- a/samples/ControlCatalog/Pages/RadioButtonPage.xaml
+++ b/samples/ControlCatalog/Pages/RadioButtonPage.xaml
@@ -11,9 +11,9 @@
Spacing="16">
- Option 1
- Option 2
- Option 3
+ _Option 1
+ O_ption 2
+ Op_tion 3
Disabled
-
+
+
+
+ Custom context flyout
+
+
+
-
+
@@ -24,7 +24,7 @@
-
@@ -40,7 +40,7 @@ ContentOff="Off" />"
-
+
diff --git a/src/Avalonia.Controls.DataGrid/DataGrid.cs b/src/Avalonia.Controls.DataGrid/DataGrid.cs
index fea02dabf4..10c7c16488 100644
--- a/src/Avalonia.Controls.DataGrid/DataGrid.cs
+++ b/src/Avalonia.Controls.DataGrid/DataGrid.cs
@@ -2223,6 +2223,7 @@ namespace Avalonia.Controls
if (IsEnabled && DisplayData.NumDisplayedScrollingElements > 0)
{
var handled = false;
+ var ignoreInvalidate = false;
var scrollHeight = 0d;
// Vertical scroll handling
@@ -2252,8 +2253,7 @@ namespace Avalonia.Controls
// Horizontal scroll handling
if (delta.X != 0)
{
- var originalHorizontalOffset = HorizontalOffset;
- var horizontalOffset = originalHorizontalOffset - delta.X;
+ var horizontalOffset = HorizontalOffset - delta.X;
var widthNotVisible = Math.Max(0, ColumnsInternal.VisibleEdgedColumnsWidth - CellsWidth);
if (horizontalOffset < 0)
@@ -2265,16 +2265,20 @@ namespace Avalonia.Controls
horizontalOffset = widthNotVisible;
}
- if (horizontalOffset != originalHorizontalOffset)
+ if (UpdateHorizontalOffset(horizontalOffset))
{
- HorizontalOffset = horizontalOffset;
+ // We don't need to invalidate once again after UpdateHorizontalOffset.
+ ignoreInvalidate = true;
handled = true;
}
}
if (handled)
{
- InvalidateRowsMeasure(invalidateIndividualElements: false);
+ if (!ignoreInvalidate)
+ {
+ InvalidateRowsMeasure(invalidateIndividualElements: false);
+ }
return true;
}
}
@@ -2932,7 +2936,7 @@ namespace Avalonia.Controls
return SetCurrentCellCore(columnIndex, slot, commitEdit: true, endRowEdit: true);
}
- internal void UpdateHorizontalOffset(double newValue)
+ internal bool UpdateHorizontalOffset(double newValue)
{
if (HorizontalOffset != newValue)
{
@@ -2940,7 +2944,9 @@ namespace Avalonia.Controls
InvalidateColumnHeadersMeasure();
InvalidateRowsMeasure(true);
+ return true;
}
+ return false;
}
internal bool UpdateSelectionAndCurrency(int columnIndex, int slot, DataGridSelectionAction action, bool scrollIntoView)
diff --git a/src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs b/src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs
index 85fd55800a..915b36687c 100644
--- a/src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs
+++ b/src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs
@@ -35,6 +35,7 @@ namespace Avalonia.Controls
private const int DATAGRIDCOLUMNHEADER_resizeRegionWidth = 5;
private const double DATAGRIDCOLUMNHEADER_separatorThickness = 1;
+ private const int DATAGRIDCOLUMNHEADER_columnsDragTreshold = 5;
private bool _areHandlersSuspended;
private static DragMode _dragMode;
@@ -448,19 +449,6 @@ namespace Avalonia.Controls
OnMouseMove_Reorder(ref handled, mousePosition, mousePositionHeaders, distanceFromLeft, distanceFromRight);
- // if we still haven't done anything about moving the mouse while
- // the button is down, we remember that we're dragging, but we don't
- // claim to have actually handled the event
- if (_dragMode == DragMode.MouseDown)
- {
- _dragMode = DragMode.Drag;
- }
-
- _lastMousePositionHeaders = mousePositionHeaders;
-
- if (args.Pointer.Captured != this && _dragMode == DragMode.Drag)
- args.Pointer.Capture(this);
-
SetDragCursor(mousePosition);
}
@@ -732,15 +720,19 @@ namespace Avalonia.Controls
{
return;
}
-
+
//handle entry into reorder mode
- if (_dragMode == DragMode.MouseDown && _dragColumn == null && (distanceFromRight > DATAGRIDCOLUMNHEADER_resizeRegionWidth && distanceFromLeft > DATAGRIDCOLUMNHEADER_resizeRegionWidth))
+ if (_dragMode == DragMode.MouseDown && _dragColumn == null && _lastMousePositionHeaders != null && (distanceFromRight > DATAGRIDCOLUMNHEADER_resizeRegionWidth && distanceFromLeft > DATAGRIDCOLUMNHEADER_resizeRegionWidth))
{
- handled = CanReorderColumn(OwningColumn);
-
- if (handled)
+ var distanceFromInitial = (Vector)(mousePositionHeaders - _lastMousePositionHeaders);
+ if (distanceFromInitial.Length > DATAGRIDCOLUMNHEADER_columnsDragTreshold)
{
- OnMouseMove_BeginReorder(mousePosition);
+ handled = CanReorderColumn(OwningColumn);
+
+ if (handled)
+ {
+ OnMouseMove_BeginReorder(mousePosition);
+ }
}
}
diff --git a/src/Avalonia.Controls/Border.cs b/src/Avalonia.Controls/Border.cs
index c8337df99c..0c6949465b 100644
--- a/src/Avalonia.Controls/Border.cs
+++ b/src/Avalonia.Controls/Border.cs
@@ -8,7 +8,9 @@ namespace Avalonia.Controls
///
/// A control which decorates a child with a border and background.
///
+#pragma warning disable CS0618 // Type or member is obsolete
public partial class Border : Decorator, IVisualWithRoundRectClip
+#pragma warning restore CS0618 // Type or member is obsolete
{
///
/// Defines the property.
diff --git a/src/Avalonia.Controls/Button.cs b/src/Avalonia.Controls/Button.cs
index 6912b2db63..8b22cdd4ec 100644
--- a/src/Avalonia.Controls/Button.cs
+++ b/src/Avalonia.Controls/Button.cs
@@ -99,6 +99,7 @@ namespace Avalonia.Controls
CommandParameterProperty.Changed.Subscribe(CommandParameterChanged);
IsDefaultProperty.Changed.Subscribe(IsDefaultChanged);
IsCancelProperty.Changed.Subscribe(IsCancelChanged);
+ AccessKeyHandler.AccessKeyPressedEvent.AddClassHandler
[PseudoClasses(":empty", ":singleitem")]
- public class ItemsControl : TemplatedControl, IItemsPresenterHost, ICollectionChangedListener
+ public class ItemsControl : TemplatedControl, IItemsPresenterHost, ICollectionChangedListener, IChildIndexProvider
{
///
/// The default value for the property.
@@ -56,6 +56,7 @@ namespace Avalonia.Controls
private IEnumerable _items = new AvaloniaList