From 817ef37b806ef5876e7305f49e85d2fceff22bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Tue, 2 Feb 2021 13:59:31 +0000 Subject: [PATCH 01/16] Fixed NativeControlHost to prevent calling ShowInBounds when control bounds are empty. --- src/Avalonia.Controls/NativeControlHost.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/NativeControlHost.cs b/src/Avalonia.Controls/NativeControlHost.cs index 20eac11c2c..64414b1f47 100644 --- a/src/Avalonia.Controls/NativeControlHost.cs +++ b/src/Avalonia.Controls/NativeControlHost.cs @@ -157,10 +157,14 @@ namespace Avalonia.Controls var needsShow = IsEffectivelyVisible && bounds.HasValue; if (needsShow) + { + if (bounds.Value.IsEmpty) + return false; _attachment?.ShowInBounds(bounds.Value); + } else _attachment?.HideWithSize(Bounds.Size); - return false; + return true; } private void CheckDestruction() From dedc9c9f8967ab58c39b37e16fa461f6f9ab213a Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 23 Feb 2021 15:12:04 +0100 Subject: [PATCH 02/16] Fix Slider focus. Previously the `Slider` itself was not focusable but the repeat buttons were - instead make the slider focusable and the repeat buttons unfocusable. --- src/Avalonia.Controls/Slider.cs | 1 + src/Avalonia.Themes.Default/Slider.xaml | 1 + src/Avalonia.Themes.Fluent/Controls/Slider.xaml | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Controls/Slider.cs b/src/Avalonia.Controls/Slider.cs index 74de33529a..849b768221 100644 --- a/src/Avalonia.Controls/Slider.cs +++ b/src/Avalonia.Controls/Slider.cs @@ -93,6 +93,7 @@ namespace Avalonia.Controls static Slider() { PressedMixin.Attach(); + FocusableProperty.OverrideDefaultValue(true); OrientationProperty.OverrideDefaultValue(typeof(Slider), Orientation.Horizontal); Thumb.DragStartedEvent.AddClassHandler((x, e) => x.OnThumbDragStarted(e), RoutingStrategies.Bubble); Thumb.DragCompletedEvent.AddClassHandler((x, e) => x.OnThumbDragCompleted(e), diff --git a/src/Avalonia.Themes.Default/Slider.xaml b/src/Avalonia.Themes.Default/Slider.xaml index ba4b1ee998..be698608c4 100644 --- a/src/Avalonia.Themes.Default/Slider.xaml +++ b/src/Avalonia.Themes.Default/Slider.xaml @@ -80,6 +80,7 @@