From 605ede79945df03ff6efb7a50304e5d0dd09381e Mon Sep 17 00:00:00 2001 From: Dariusz Komosinski Date: Tue, 26 May 2020 12:07:31 +0200 Subject: [PATCH 01/28] Fix invalid navigation direction for Tab. --- src/Avalonia.Input/NavigationDirection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Input/NavigationDirection.cs b/src/Avalonia.Input/NavigationDirection.cs index 34bedac141..9b9af0b0a6 100644 --- a/src/Avalonia.Input/NavigationDirection.cs +++ b/src/Avalonia.Input/NavigationDirection.cs @@ -102,7 +102,7 @@ namespace Avalonia.Input switch (key) { case Key.Tab: - return (modifiers & KeyModifiers.Shift) != 0 ? + return (modifiers & KeyModifiers.Shift) == 0 ? NavigationDirection.Next : NavigationDirection.Previous; case Key.Up: return NavigationDirection.Up; From b99184b815e2ec05dd770c6eb4f7a153543c71db Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 28 May 2020 17:20:53 -0300 Subject: [PATCH 02/28] Add resources for listbox. --- .../Accents/FluentBaseDark.xaml | 18 ++++++++++++++++++ .../Accents/FluentBaseLight.xaml | 18 ++++++++++++++++++ .../Accents/FluentControlResourcesDark.xaml | 18 ++++++++++++++++++ .../Accents/FluentControlResourcesLight.xaml | 18 ++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml index ed6f56b211..292870c3cf 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml @@ -85,6 +85,24 @@ + + 0 + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml index ac7b792a9a..f734e1eff8 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml @@ -86,6 +86,24 @@ + + 0 + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml index a0f3ef0d62..3f9dc68383 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml @@ -39,6 +39,24 @@ + + 0 + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml index ec4f35664c..46b8f4422c 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml @@ -39,6 +39,24 @@ + + 0 + + + + + + + + + + + + + + + + From 6e55912c75c6af942d0e59e34cf04948feb9f553 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 28 May 2020 17:33:36 -0300 Subject: [PATCH 03/28] fully ported listbox and listbox items --- src/Avalonia.Themes.Fluent/ListBox.xaml | 70 +++++++++------- src/Avalonia.Themes.Fluent/ListBoxItem.xaml | 90 +++++++++++++++++---- 2 files changed, 114 insertions(+), 46 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/ListBox.xaml b/src/Avalonia.Themes.Fluent/ListBox.xaml index e91d8a6772..7a87387de8 100644 --- a/src/Avalonia.Themes.Fluent/ListBox.xaml +++ b/src/Avalonia.Themes.Fluent/ListBox.xaml @@ -1,31 +1,43 @@ - - + + + + Test + Test + Test + Test + + + + + diff --git a/src/Avalonia.Themes.Fluent/ListBoxItem.xaml b/src/Avalonia.Themes.Fluent/ListBoxItem.xaml index 19a6e3d4ec..430d3c5468 100644 --- a/src/Avalonia.Themes.Fluent/ListBoxItem.xaml +++ b/src/Avalonia.Themes.Fluent/ListBoxItem.xaml @@ -1,12 +1,27 @@ - + + + + + Disabled + Test + Test + + + + + 12,9,12,12 + - + + + + + + + + + + + + + + + - - - + + + + - - + From 01c327d3bfb6538a1c08716471974d55c981a74e Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 28 May 2020 17:34:00 -0300 Subject: [PATCH 04/28] Add pressed pseudo class to ListBoxItem. --- src/Avalonia.Controls/ListBoxItem.cs | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/Avalonia.Controls/ListBoxItem.cs b/src/Avalonia.Controls/ListBoxItem.cs index 199c9e0ff8..46a7ccec0b 100644 --- a/src/Avalonia.Controls/ListBoxItem.cs +++ b/src/Avalonia.Controls/ListBoxItem.cs @@ -1,4 +1,5 @@ using Avalonia.Controls.Mixins; +using Avalonia.Input; namespace Avalonia.Controls { @@ -30,5 +31,34 @@ namespace Avalonia.Controls get { return GetValue(IsSelectedProperty); } set { SetValue(IsSelectedProperty, value); } } + + protected override void OnPointerPressed(PointerPressedEventArgs e) + { + base.OnPointerPressed(e); + + if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) + { + UpdatePseudoClasses(true); + } + } + + protected override void OnPointerReleased(PointerReleasedEventArgs e) + { + base.OnPointerReleased(e); + + UpdatePseudoClasses(false); + } + + protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e) + { + base.OnPointerCaptureLost(e); + + UpdatePseudoClasses(false); + } + + private void UpdatePseudoClasses(bool isPressed) + { + PseudoClasses.Set(":pressed", isPressed); + } } } From c961df9ee1e04f8ef39905ed9c866f1173edb051 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 28 May 2020 19:34:53 -0300 Subject: [PATCH 05/28] fix unit for listbox test. --- .../Primitives/SelectingItemsControlTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs b/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs index 04d0ac0a7a..fe9c7b1261 100644 --- a/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs +++ b/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs @@ -994,7 +994,7 @@ namespace Avalonia.Controls.UnitTests.Primitives target.Presenter.ApplyTemplate(); _helper.Down((Interactive)target.Presenter.Panel.Children[3]); - Assert.Equal(new[] { ":selected" }, target.Presenter.Panel.Children[3].Classes); + Assert.Equal(new[] { ":pressed", ":selected" }, target.Presenter.Panel.Children[3].Classes); } [Fact] From 817476ef77401cf42980147def0aa0067f658647 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 13:31:03 -0300 Subject: [PATCH 06/28] implement a pressed mixin. --- src/Avalonia.Controls/Mixins/PressedMixin.cs | 33 +++++++++++++++++ .../Mixins/PressedMixinTests.cs | 37 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/Avalonia.Controls/Mixins/PressedMixin.cs create mode 100644 tests/Avalonia.Controls.UnitTests/Mixins/PressedMixinTests.cs diff --git a/src/Avalonia.Controls/Mixins/PressedMixin.cs b/src/Avalonia.Controls/Mixins/PressedMixin.cs new file mode 100644 index 0000000000..01b0a8564f --- /dev/null +++ b/src/Avalonia.Controls/Mixins/PressedMixin.cs @@ -0,0 +1,33 @@ +using Avalonia.Interactivity; +using Avalonia.Input; + +namespace Avalonia.Controls.Mixins +{ + /// + /// Adds pressed functionality to control classes. + /// + /// Adds the ':pressed' class when the item is pressed. + /// + public static class PressedMixin + { + private static void HandlePointerPressed(TControl sender, PointerPressedEventArgs e) where TControl : Control + { + if (e.GetCurrentPoint(sender).Properties.IsLeftButtonPressed) + { + ((IPseudoClasses)sender.Classes).Set(":pressed", true); + } + } + + private static void HandlePointerReleased(TControl sender) where TControl : Control + { + ((IPseudoClasses)sender.Classes).Set(":pressed", false); + } + + public static void Attach() where TControl : Control + { + InputElement.PointerPressedEvent.AddClassHandler((x, e) => HandlePointerPressed(x, e), RoutingStrategies.Tunnel, true); + InputElement.PointerReleasedEvent.AddClassHandler((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel, true); + InputElement.PointerCaptureLostEvent.AddClassHandler((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel, true); + } + } +} diff --git a/tests/Avalonia.Controls.UnitTests/Mixins/PressedMixinTests.cs b/tests/Avalonia.Controls.UnitTests/Mixins/PressedMixinTests.cs new file mode 100644 index 0000000000..0ff1f40121 --- /dev/null +++ b/tests/Avalonia.Controls.UnitTests/Mixins/PressedMixinTests.cs @@ -0,0 +1,37 @@ +using Avalonia.Controls.Mixins; +using Avalonia.UnitTests; +using Xunit; + +namespace Avalonia.Controls.UnitTests.Mixins +{ + public class PressedMixinTests + { + private MouseTestHelper _mouse = new MouseTestHelper(); + + [Fact] + public void Selected_Class_Should_Not_Initially_Be_Added() + { + var target = new TestControl(); + + Assert.Empty(target.Classes); + } + + [Fact] + public void Setting_IsSelected_Should_Add_Selected_Class() + { + var target = new TestControl(); + + _mouse.Down(target); + + Assert.Equal(new[] { ":pressed" }, target.Classes); + } + + private class TestControl : Control + { + static TestControl() + { + PressedMixin.Attach(); + } + } + } +} From 852d24c713d3e00e7aea0f881a7e2065826c818b Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 13:31:20 -0300 Subject: [PATCH 07/28] listbox item gets pressed mixin. --- src/Avalonia.Controls/ListBoxItem.cs | 30 +--------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/Avalonia.Controls/ListBoxItem.cs b/src/Avalonia.Controls/ListBoxItem.cs index 46a7ccec0b..e04c79987f 100644 --- a/src/Avalonia.Controls/ListBoxItem.cs +++ b/src/Avalonia.Controls/ListBoxItem.cs @@ -20,6 +20,7 @@ namespace Avalonia.Controls static ListBoxItem() { SelectableMixin.Attach(IsSelectedProperty); + PressedMixin.Attach(); FocusableProperty.OverrideDefaultValue(true); } @@ -31,34 +32,5 @@ namespace Avalonia.Controls get { return GetValue(IsSelectedProperty); } set { SetValue(IsSelectedProperty, value); } } - - protected override void OnPointerPressed(PointerPressedEventArgs e) - { - base.OnPointerPressed(e); - - if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) - { - UpdatePseudoClasses(true); - } - } - - protected override void OnPointerReleased(PointerReleasedEventArgs e) - { - base.OnPointerReleased(e); - - UpdatePseudoClasses(false); - } - - protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e) - { - base.OnPointerCaptureLost(e); - - UpdatePseudoClasses(false); - } - - private void UpdatePseudoClasses(bool isPressed) - { - PseudoClasses.Set(":pressed", isPressed); - } } } From 4bd7d4d7a5b74a1ffbff289c3416bbfd86df0020 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 13:42:56 -0300 Subject: [PATCH 08/28] tidy pressed mixin. --- src/Avalonia.Controls/Mixins/PressedMixin.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Avalonia.Controls/Mixins/PressedMixin.cs b/src/Avalonia.Controls/Mixins/PressedMixin.cs index 01b0a8564f..4c5792b4a0 100644 --- a/src/Avalonia.Controls/Mixins/PressedMixin.cs +++ b/src/Avalonia.Controls/Mixins/PressedMixin.cs @@ -10,6 +10,17 @@ namespace Avalonia.Controls.Mixins /// public static class PressedMixin { + /// + /// Initializes a new instance of the class. + /// + /// The control type. + public static void Attach() where TControl : Control + { + InputElement.PointerPressedEvent.AddClassHandler((x, e) => HandlePointerPressed(x, e), RoutingStrategies.Tunnel); + InputElement.PointerReleasedEvent.AddClassHandler((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel); + InputElement.PointerCaptureLostEvent.AddClassHandler((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel); + } + private static void HandlePointerPressed(TControl sender, PointerPressedEventArgs e) where TControl : Control { if (e.GetCurrentPoint(sender).Properties.IsLeftButtonPressed) @@ -22,12 +33,5 @@ namespace Avalonia.Controls.Mixins { ((IPseudoClasses)sender.Classes).Set(":pressed", false); } - - public static void Attach() where TControl : Control - { - InputElement.PointerPressedEvent.AddClassHandler((x, e) => HandlePointerPressed(x, e), RoutingStrategies.Tunnel, true); - InputElement.PointerReleasedEvent.AddClassHandler((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel, true); - InputElement.PointerCaptureLostEvent.AddClassHandler((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel, true); - } } } From 0750db0df854bd00be93afcaa290e4edff9bb43a Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Fri, 29 May 2020 17:41:45 +0800 Subject: [PATCH 09/28] tryin' to port fluent radiobutton --- .../Accents/FluentBaseDark.xaml | 45 +++++- .../Accents/FluentBaseLight.xaml | 45 +++++- .../Accents/FluentControlResourcesDark.xaml | 54 +++++++ .../Accents/FluentControlResourcesLight.xaml | 54 +++++++ src/Avalonia.Themes.Fluent/RadioButton.xaml | 136 ++++++++++++------ 5 files changed, 273 insertions(+), 61 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml index 292870c3cf..43abb34eb9 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml @@ -1,6 +1,4 @@ - diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml index f734e1eff8..c2897e4a65 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml @@ -1,6 +1,4 @@ - diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml index 3f9dc68383..f09569e613 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml @@ -171,5 +171,59 @@ + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml index 46b8f4422c..97497495be 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml @@ -171,5 +171,59 @@ + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Themes.Fluent/RadioButton.xaml b/src/Avalonia.Themes.Fluent/RadioButton.xaml index 4cdb116cdd..fa2077f222 100644 --- a/src/Avalonia.Themes.Fluent/RadioButton.xaml +++ b/src/Avalonia.Themes.Fluent/RadioButton.xaml @@ -1,60 +1,102 @@ - - - - - - - + + + + + + + + + + + + + + From dea12ed7bce0aeab077303b8ffcb56717cc304e2 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 09:51:28 -0300 Subject: [PATCH 10/28] tidy radio button --- .../Accents/FluentBaseDark.xaml | 8 +++ .../Accents/FluentBaseLight.xaml | 7 +++ src/Avalonia.Themes.Fluent/RadioButton.xaml | 59 ++++++++++++++++--- 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml index 43abb34eb9..9fe9f5389e 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml @@ -31,9 +31,11 @@ #FF1D1D1D #FF333333 + 2,2,2,2 4,4,4,4 + 1,1,1,1 1,1,1,1 @@ -59,6 +61,7 @@ 1,1,1,1 1,1,1,1 1 + #FF005A9E #FF004275 @@ -68,6 +71,7 @@ #FFA6D8FF #FF000000 + @@ -81,6 +85,7 @@ + 0 @@ -98,6 +103,7 @@ + @@ -129,6 +135,7 @@ + @@ -202,6 +209,7 @@ + diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml index c2897e4a65..87cc0d38a0 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml @@ -31,9 +31,11 @@ #FFE6E6E6 #FFCCCCCC + 2,2,2,2 4,4,4,4 + 1,1,1,1 1,1,1,1 @@ -59,6 +61,7 @@ 1,1,1,1 1,1,1,1 1 + #FF005A9E #FF004275 @@ -69,6 +72,7 @@ #FFFFFFFF + @@ -99,6 +103,7 @@ + @@ -130,6 +135,7 @@ + @@ -203,6 +209,7 @@ + diff --git a/src/Avalonia.Themes.Fluent/RadioButton.xaml b/src/Avalonia.Themes.Fluent/RadioButton.xaml index fa2077f222..f425a98864 100644 --- a/src/Avalonia.Themes.Fluent/RadioButton.xaml +++ b/src/Avalonia.Themes.Fluent/RadioButton.xaml @@ -1,4 +1,11 @@ + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + From 303c5f13e057b74c6ba8f7a76a70363189f2c918 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Fri, 29 May 2020 21:57:54 +0300 Subject: [PATCH 13/28] Restore pre-BoxShadow rect deflation behavior --- src/Avalonia.Controls/Utils/BorderRenderHelper.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs index 586fe4d341..8fe2edd1f2 100644 --- a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs +++ b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs @@ -118,12 +118,11 @@ namespace Avalonia.Controls.Utils pen = new Pen(borderBrush, borderThickness); } - var rrect = new RoundedRect(new Rect(_size), _cornerRadius.TopLeft, _cornerRadius.TopRight, - _cornerRadius.BottomRight, _cornerRadius.BottomLeft); + var rect = new Rect(_size); if (Math.Abs(borderThickness) > double.Epsilon) - { - rrect = rrect.Deflate(borderThickness * 0.5, borderThickness * 0.5); - } + rect.Deflate(borderThickness * 0.5); + var rrect = new RoundedRect(rect, _cornerRadius.TopLeft, _cornerRadius.TopRight, + _cornerRadius.BottomRight, _cornerRadius.BottomLeft); context.PlatformImpl.DrawRectangle(background, pen, rrect, boxShadows); } From 34f1b088cfa93aabb83e1da0676e84a94d60231f Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Fri, 29 May 2020 22:10:18 +0300 Subject: [PATCH 14/28] Actually deflate the rect and never merge before testing --- src/Avalonia.Controls/Utils/BorderRenderHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs index 8fe2edd1f2..51eb6edbea 100644 --- a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs +++ b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs @@ -120,7 +120,7 @@ namespace Avalonia.Controls.Utils var rect = new Rect(_size); if (Math.Abs(borderThickness) > double.Epsilon) - rect.Deflate(borderThickness * 0.5); + rect = rect.Deflate(borderThickness * 0.5); var rrect = new RoundedRect(rect, _cornerRadius.TopLeft, _cornerRadius.TopRight, _cornerRadius.BottomRight, _cornerRadius.BottomLeft); From 25013c02d678b0a7487d18d55f6a89d06c10b996 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 16:16:20 -0300 Subject: [PATCH 15/28] add hint for wm drop shadow. --- src/Avalonia.Controls/Platform/IPopupImpl.cs | 2 ++ src/Avalonia.Controls/Primitives/PopupRoot.cs | 11 ++++++ src/Avalonia.DesignerSupport/Remote/Stubs.cs | 4 +++ src/Avalonia.Native/PopupImpl.cs | 5 +++ src/Avalonia.X11/X11Window.cs | 4 +++ src/Windows/Avalonia.Win32/PopupImpl.cs | 34 ++++++++++++++++--- 6 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Controls/Platform/IPopupImpl.cs b/src/Avalonia.Controls/Platform/IPopupImpl.cs index 3944695f04..477d5fab43 100644 --- a/src/Avalonia.Controls/Platform/IPopupImpl.cs +++ b/src/Avalonia.Controls/Platform/IPopupImpl.cs @@ -8,5 +8,7 @@ namespace Avalonia.Platform public interface IPopupImpl : IWindowBaseImpl { IPopupPositioner PopupPositioner { get; } + + void SetWindowManagerAddShadowHint(bool enabled); } } diff --git a/src/Avalonia.Controls/Primitives/PopupRoot.cs b/src/Avalonia.Controls/Primitives/PopupRoot.cs index 788fe03162..e96d70618a 100644 --- a/src/Avalonia.Controls/Primitives/PopupRoot.cs +++ b/src/Avalonia.Controls/Primitives/PopupRoot.cs @@ -19,12 +19,17 @@ namespace Avalonia.Controls.Primitives private readonly TopLevel _parent; private PopupPositionerParameters _positionerParameters; + public static readonly StyledProperty WindowManagerAddShadowHintProperty = + AvaloniaProperty.Register(nameof(WindowManagerAddShadowHint), true); + /// /// Initializes static members of the class. /// static PopupRoot() { BackgroundProperty.OverrideDefaultValue(typeof(PopupRoot), Brushes.White); + + WindowManagerAddShadowHintProperty.Changed.AddClassHandler((tl, e) => tl.PlatformImpl.SetWindowManagerAddShadowHint((bool)e.NewValue)); } /// @@ -54,6 +59,12 @@ namespace Avalonia.Controls.Primitives /// [CanBeNull] public new IPopupImpl PlatformImpl => (IPopupImpl)base.PlatformImpl; + + public bool WindowManagerAddShadowHint + { + get { return GetValue(WindowManagerAddShadowHintProperty); } + set { SetValue(WindowManagerAddShadowHintProperty, value); } + } /// /// Gets the parent control in the event route. diff --git a/src/Avalonia.DesignerSupport/Remote/Stubs.cs b/src/Avalonia.DesignerSupport/Remote/Stubs.cs index a9665b1519..c2565cc59c 100644 --- a/src/Avalonia.DesignerSupport/Remote/Stubs.cs +++ b/src/Avalonia.DesignerSupport/Remote/Stubs.cs @@ -146,6 +146,10 @@ namespace Avalonia.DesignerSupport.Remote public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel) { } + public void SetWindowManagerAddShadowHint(bool enabled) + { + } + public WindowTransparencyLevel TransparencyLevel { get; private set; } } diff --git a/src/Avalonia.Native/PopupImpl.cs b/src/Avalonia.Native/PopupImpl.cs index e4ee293757..c41be1723b 100644 --- a/src/Avalonia.Native/PopupImpl.cs +++ b/src/Avalonia.Native/PopupImpl.cs @@ -59,6 +59,11 @@ namespace Avalonia.Native } public override IPopupImpl CreatePopup() => new PopupImpl(_factory, _opts, _glFeature, this); + + public void SetWindowManagerAddShadowHint(bool enabled) + { + } + public IPopupPositioner PopupPositioner { get; } } } diff --git a/src/Avalonia.X11/X11Window.cs b/src/Avalonia.X11/X11Window.cs index 4899f0efc0..1d41fe4bdd 100644 --- a/src/Avalonia.X11/X11Window.cs +++ b/src/Avalonia.X11/X11Window.cs @@ -1098,6 +1098,10 @@ namespace Avalonia.X11 public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel) => _transparencyHelper.SetTransparencyRequest(transparencyLevel); + public void SetWindowManagerAddShadowHint(bool enabled) + { + } + public WindowTransparencyLevel TransparencyLevel => _transparencyHelper.CurrentLevel; } } diff --git a/src/Windows/Avalonia.Win32/PopupImpl.cs b/src/Windows/Avalonia.Win32/PopupImpl.cs index 504cefb9b3..eeaf569ec2 100644 --- a/src/Windows/Avalonia.Win32/PopupImpl.cs +++ b/src/Windows/Avalonia.Win32/PopupImpl.cs @@ -7,6 +7,8 @@ namespace Avalonia.Win32 { class PopupImpl : WindowImpl, IPopupImpl { + private bool _hasBoxShadow = true; + public override void Show() { UnmanagedMethods.ShowWindow(Handle.Handle, UnmanagedMethods.ShowWindowCommand.ShowNoActivate); @@ -36,11 +38,7 @@ namespace Avalonia.Win32 IntPtr.Zero, IntPtr.Zero); - var classes = (int)UnmanagedMethods.GetClassLongPtr(result, (int)UnmanagedMethods.ClassLongIndex.GCL_STYLE); - - classes |= (int)UnmanagedMethods.ClassStyles.CS_DROPSHADOW; - - UnmanagedMethods.SetClassLong(result, UnmanagedMethods.ClassLongIndex.GCL_STYLE, new IntPtr(classes)); + EnableBoxShadow(result, _hasBoxShadow); return result; } @@ -68,6 +66,32 @@ namespace Avalonia.Win32 //TODO: We ignore the scaling override for now } + private void EnableBoxShadow (IntPtr hwnd, bool enabled) + { + var classes = (int)UnmanagedMethods.GetClassLongPtr(hwnd, (int)UnmanagedMethods.ClassLongIndex.GCL_STYLE); + + if (enabled) + { + classes |= (int)UnmanagedMethods.ClassStyles.CS_DROPSHADOW; + } + else + { + classes &= ~(int)UnmanagedMethods.ClassStyles.CS_DROPSHADOW; + } + + UnmanagedMethods.SetClassLong(hwnd, UnmanagedMethods.ClassLongIndex.GCL_STYLE, new IntPtr(classes)); + } + + public void SetWindowManagerAddShadowHint(bool enabled) + { + _hasBoxShadow = enabled; + + if (Handle != null) + { + EnableBoxShadow(Handle.Handle, enabled); + } + } + public IPopupPositioner PopupPositioner { get; } } } From 46a3c1eb157f0b2ee5f4c33449f968e81bdb2ac8 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 17:39:08 -0300 Subject: [PATCH 16/28] move popup hint property. --- src/Avalonia.Controls/Primitives/Popup.cs | 21 ++++++++++++++++++- src/Avalonia.Controls/Primitives/PopupRoot.cs | 17 +++------------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/Avalonia.Controls/Primitives/Popup.cs b/src/Avalonia.Controls/Primitives/Popup.cs index 66f2153b6c..49315e1b25 100644 --- a/src/Avalonia.Controls/Primitives/Popup.cs +++ b/src/Avalonia.Controls/Primitives/Popup.cs @@ -19,6 +19,9 @@ namespace Avalonia.Controls.Primitives /// public class Popup : Control, IVisualTreeHost { + public static readonly StyledProperty WindowManagerAddShadowHintProperty = + AvaloniaProperty.Register(nameof(WindowManagerAddShadowHint), true); + /// /// Defines the property. /// @@ -89,7 +92,7 @@ namespace Avalonia.Controls.Primitives { IsHitTestVisibleProperty.OverrideDefaultValue(false); ChildProperty.Changed.AddClassHandler((x, e) => x.ChildChanged(e)); - IsOpenProperty.Changed.AddClassHandler((x, e) => x.IsOpenChanged((AvaloniaPropertyChangedEventArgs)e)); + IsOpenProperty.Changed.AddClassHandler((x, e) => x.IsOpenChanged((AvaloniaPropertyChangedEventArgs)e)); } /// @@ -104,6 +107,12 @@ namespace Avalonia.Controls.Primitives public IPopupHost? Host => _openState?.PopupHost; + public bool WindowManagerAddShadowHint + { + get { return GetValue(WindowManagerAddShadowHintProperty); } + set { SetValue(WindowManagerAddShadowHintProperty, value); } + } + /// /// Gets or sets the control to display in the popup. /// @@ -293,6 +302,8 @@ namespace Avalonia.Controls.Primitives _openState = new PopupOpenState(topLevel, popupHost, cleanupPopup); + WindowManagerAddShadowHintChanged(popupHost, WindowManagerAddShadowHint); + popupHost.Show(); using (BeginIgnoringIsOpen()) @@ -332,6 +343,14 @@ namespace Avalonia.Controls.Primitives return Disposable.Create((unsubscribe, target, handler), state => state.unsubscribe(state.target, state.handler)); } + private void WindowManagerAddShadowHintChanged(IPopupHost host, bool hint) + { + if(host is PopupRoot pr) + { + pr.PlatformImpl.SetWindowManagerAddShadowHint(hint); + } + } + /// /// Called when the property changes. /// diff --git a/src/Avalonia.Controls/Primitives/PopupRoot.cs b/src/Avalonia.Controls/Primitives/PopupRoot.cs index e96d70618a..aab7a68795 100644 --- a/src/Avalonia.Controls/Primitives/PopupRoot.cs +++ b/src/Avalonia.Controls/Primitives/PopupRoot.cs @@ -17,19 +17,14 @@ namespace Avalonia.Controls.Primitives public sealed class PopupRoot : WindowBase, IInteractive, IHostedVisualTreeRoot, IDisposable, IStyleHost, IPopupHost { private readonly TopLevel _parent; - private PopupPositionerParameters _positionerParameters; - - public static readonly StyledProperty WindowManagerAddShadowHintProperty = - AvaloniaProperty.Register(nameof(WindowManagerAddShadowHint), true); + private PopupPositionerParameters _positionerParameters; /// /// Initializes static members of the class. /// static PopupRoot() { - BackgroundProperty.OverrideDefaultValue(typeof(PopupRoot), Brushes.White); - - WindowManagerAddShadowHintProperty.Changed.AddClassHandler((tl, e) => tl.PlatformImpl.SetWindowManagerAddShadowHint((bool)e.NewValue)); + BackgroundProperty.OverrideDefaultValue(typeof(PopupRoot), Brushes.White); } /// @@ -58,13 +53,7 @@ namespace Avalonia.Controls.Primitives /// Gets the platform-specific window implementation. /// [CanBeNull] - public new IPopupImpl PlatformImpl => (IPopupImpl)base.PlatformImpl; - - public bool WindowManagerAddShadowHint - { - get { return GetValue(WindowManagerAddShadowHintProperty); } - set { SetValue(WindowManagerAddShadowHintProperty, value); } - } + public new IPopupImpl PlatformImpl => (IPopupImpl)base.PlatformImpl; /// /// Gets the parent control in the event route. From 9682fd9b21844e3dda9e9859105abfcc61efee4c Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 17:59:02 -0300 Subject: [PATCH 17/28] DropShadowHint rename --- src/Windows/Avalonia.Win32/PopupImpl.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Windows/Avalonia.Win32/PopupImpl.cs b/src/Windows/Avalonia.Win32/PopupImpl.cs index eeaf569ec2..efcf1ea674 100644 --- a/src/Windows/Avalonia.Win32/PopupImpl.cs +++ b/src/Windows/Avalonia.Win32/PopupImpl.cs @@ -7,7 +7,7 @@ namespace Avalonia.Win32 { class PopupImpl : WindowImpl, IPopupImpl { - private bool _hasBoxShadow = true; + private bool _dropShadowHint = true; public override void Show() { @@ -38,7 +38,7 @@ namespace Avalonia.Win32 IntPtr.Zero, IntPtr.Zero); - EnableBoxShadow(result, _hasBoxShadow); + EnableBoxShadow(result, _dropShadowHint); return result; } @@ -84,7 +84,7 @@ namespace Avalonia.Win32 public void SetWindowManagerAddShadowHint(bool enabled) { - _hasBoxShadow = enabled; + _dropShadowHint = enabled; if (Handle != null) { From 324c6ef5cea83b5b53a9670f23a1f763d7ad1b19 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 29 May 2020 01:12:51 -0400 Subject: [PATCH 18/28] Add resources for AutoCompleteBox --- src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml | 12 ++++++------ src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml | 12 ++++++------ .../Accents/FluentBaseDark.xaml | 8 +++++++- .../Accents/FluentBaseLight.xaml | 8 +++++++- .../Accents/FluentControlResourcesDark.xaml | 6 ++++++ .../Accents/FluentControlResourcesLight.xaml | 6 ++++++ 6 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml b/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml index 7ce6c5a19f..b404661d1d 100644 --- a/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml @@ -159,8 +159,8 @@ 24 40 3 - 374 - 0 + 374 + 0 2 0 21 @@ -258,10 +258,10 @@ 0,0,0,0 0,0,0,0 3,0,3,0 - 1 - 0,2,0,2 - -1,0,-1,0 - 12,11,0,13 + 1 + 0,2,0,2 + -1,0,-1,0 + 12,11,0,13 2 2 2 diff --git a/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml b/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml index 026edca4f9..b370ec7dbf 100644 --- a/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml @@ -158,8 +158,8 @@ 24 40 3 - 374 - 0 + 374 + 0 2 0 21 @@ -257,10 +257,10 @@ 0,0,0,0 0,0,0,0 3,0,3,0 - 1 - 0,2,0,2 - -1,0,-1,0 - 12,11,0,13 + 1 + 0,2,0,2 + -1,0,-1,0 + 12,11,0,13 2 2 2 diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml index 9fe9f5389e..57216c008a 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml @@ -135,7 +135,13 @@ - + + + + + + 12 + diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml index 87cc0d38a0..bf874ce3f1 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml @@ -135,7 +135,13 @@ - + + + + + + 12 + diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml index f09569e613..d99774b788 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml @@ -82,6 +82,12 @@ + + + + + 12 + 1 0 diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml index 97497495be..79dcbae50f 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml @@ -82,6 +82,12 @@ + + + + + 12 + 1 0 From 9c67a01d624e31d478c923a2d1fa5182f083be29 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 29 May 2020 01:13:14 -0400 Subject: [PATCH 19/28] Add Fluent AutoCompleteBox Style --- .../AutoCompleteBox.xaml | 65 +++++++++++++------ 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml index 788b60892b..cdf79cac01 100644 --- a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml +++ b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml @@ -1,37 +1,64 @@ - + + + + + + Alabama + Alaska + Arizona + Arkansas + California + Colorado + Connecticut + Delaware + + + + + From 83f7890ac243744e8e6af72d05c55492bc6116ab Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 29 May 2020 01:13:53 -0400 Subject: [PATCH 20/28] Add SystemControlTransientBackgroundBrush resource with fallback color as Color value --- src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml | 1 + src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml | 1 + .../Accents/FluentControlResourcesDark.xaml | 4 ++-- .../Accents/FluentControlResourcesLight.xaml | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml b/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml index b404661d1d..c20141675d 100644 --- a/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml @@ -139,6 +139,7 @@ + False diff --git a/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml b/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml index b370ec7dbf..b25c0c6116 100644 --- a/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml @@ -139,6 +139,7 @@ + False diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml index d99774b788..ab83f4f474 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml @@ -83,8 +83,8 @@ - - + + 12 diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml index 79dcbae50f..7c132dd22f 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml @@ -83,8 +83,8 @@ - - + + 12 From 890513e8a9116ce93b70ade6876775968e59b48f Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 29 May 2020 01:54:03 -0400 Subject: [PATCH 21/28] Add missed Padding --- src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml index cdf79cac01..262b9286e0 100644 --- a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml +++ b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml @@ -37,6 +37,7 @@ FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" + Padding="{TemplateBinding Padding}" Margin="0" DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" /> @@ -53,6 +54,7 @@ CornerRadius="{DynamicResource OverlayCornerRadius}"> From e08e6a44abb3f4a571b342737ccc1c86ffa4f549 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 29 May 2020 03:18:31 -0400 Subject: [PATCH 22/28] Remove AutoCompleteListMaxHeight in favor of MaxDropDownHeight --- src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml | 1 - src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml | 1 - src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml | 1 - 3 files changed, 3 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml b/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml index c20141675d..bf169400f0 100644 --- a/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml @@ -160,7 +160,6 @@ 24 40 3 - 374 0 2 0 diff --git a/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml b/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml index b25c0c6116..b32c816851 100644 --- a/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml @@ -159,7 +159,6 @@ 24 40 3 - 374 0 2 0 diff --git a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml index 262b9286e0..97d6153c46 100644 --- a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml +++ b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml @@ -56,7 +56,6 @@ BorderThickness="0" Foreground="{DynamicResource AutoCompleteBoxSuggestionsListForeground}" ItemTemplate="{TemplateBinding ItemTemplate}" - MaxHeight="{DynamicResource AutoCompleteListMaxHeight}" Margin="{DynamicResource AutoCompleteListPadding}" /> From 6cb6820f794e49d533c09a02c9ad4f8e40313553 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 29 May 2020 05:10:11 -0400 Subject: [PATCH 23/28] Add missed default value for Padding --- src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml index 97d6153c46..c9e6d880c1 100644 --- a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml +++ b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml @@ -24,6 +24,7 @@ + From c25fe3a80cdf029b3a3b427b0f47b2cf79aa6d22 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 17:01:05 -0300 Subject: [PATCH 24/28] working transparent popup --- src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml index c9e6d880c1..11f9b85894 100644 --- a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml +++ b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml @@ -47,14 +47,22 @@ MaxHeight="{TemplateBinding MaxDropDownHeight}" StaysOpen="False" PlacementTarget="{TemplateBinding}"> + + + From 85f37abe21fccfa66c15af7f3f947bcb2b1069fc Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 29 May 2020 17:33:53 -0300 Subject: [PATCH 25/28] transparent popups --- .../AutoCompleteBox.xaml | 15 +++----- src/Avalonia.Themes.Fluent/PopupRoot.xaml | 38 ++++++++++--------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml index 11f9b85894..52bacdb36e 100644 --- a/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml +++ b/src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml @@ -1,4 +1,5 @@ - + @@ -43,17 +44,11 @@ DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" /> - - - + StaysOpen="False" + PlacementTarget="{TemplateBinding}"> - - - - - - - - - - - - + + + From fac52ec3b4e331dc14758139ab7f1a973270f2f7 Mon Sep 17 00:00:00 2001 From: amwx Date: Fri, 29 May 2020 04:08:07 -0500 Subject: [PATCH 26/28] Fluent Calendar style --- .../Accents/FluentControlResourcesDark.xaml | 27 ++ .../Accents/FluentControlResourcesLight.xaml | 27 ++ src/Avalonia.Themes.Fluent/Calendar.xaml | 13 +- .../CalendarButton.xaml | 124 ++++---- .../CalendarDayButton.xaml | 156 +++++----- src/Avalonia.Themes.Fluent/CalendarItem.xaml | 272 +++++++----------- 6 files changed, 319 insertions(+), 300 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml index ab83f4f474..472806800a 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml @@ -178,6 +178,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml index 7c132dd22f..600f66043b 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml @@ -178,6 +178,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 diff --git a/src/Avalonia.Themes.Fluent/Calendar.xaml b/src/Avalonia.Themes.Fluent/Calendar.xaml index 6bbee4ef17..2fbc705d83 100644 --- a/src/Avalonia.Themes.Fluent/Calendar.xaml +++ b/src/Avalonia.Themes.Fluent/Calendar.xaml @@ -7,11 +7,12 @@ - \ No newline at end of file + diff --git a/src/Avalonia.Themes.Fluent/CalendarButton.xaml b/src/Avalonia.Themes.Fluent/CalendarButton.xaml index 3314534b3b..2ba4489204 100644 --- a/src/Avalonia.Themes.Fluent/CalendarButton.xaml +++ b/src/Avalonia.Themes.Fluent/CalendarButton.xaml @@ -7,75 +7,99 @@ - - --> + + - - - - - - - + + + - - + + + + diff --git a/src/Avalonia.Themes.Fluent/CalendarDayButton.xaml b/src/Avalonia.Themes.Fluent/CalendarDayButton.xaml index 2d79e62a75..1e5953ab2d 100644 --- a/src/Avalonia.Themes.Fluent/CalendarDayButton.xaml +++ b/src/Avalonia.Themes.Fluent/CalendarDayButton.xaml @@ -7,110 +7,102 @@ - - - - + --> - - - - - - - - - - - - - - - - + diff --git a/src/Avalonia.Themes.Fluent/CalendarItem.xaml b/src/Avalonia.Themes.Fluent/CalendarItem.xaml index dfd89ed82f..41f3fcbc1f 100644 --- a/src/Avalonia.Themes.Fluent/CalendarItem.xaml +++ b/src/Avalonia.Themes.Fluent/CalendarItem.xaml @@ -8,176 +8,124 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - From 5065e6c072020860312c01053365105759c5e7eb Mon Sep 17 00:00:00 2001 From: amwx Date: Fri, 29 May 2020 04:24:07 -0500 Subject: [PATCH 27/28] Fluent Calendar Style --- src/Avalonia.Themes.Fluent/Calendar.xaml | 2 +- src/Avalonia.Themes.Fluent/CalendarButton.xaml | 9 ++++++--- src/Avalonia.Themes.Fluent/CalendarDayButton.xaml | 14 ++++++-------- src/Avalonia.Themes.Fluent/CalendarItem.xaml | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Calendar.xaml b/src/Avalonia.Themes.Fluent/Calendar.xaml index 2fbc705d83..6ae334dbae 100644 --- a/src/Avalonia.Themes.Fluent/Calendar.xaml +++ b/src/Avalonia.Themes.Fluent/Calendar.xaml @@ -5,7 +5,7 @@ // All other rights reserved. --> - +