diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 34f931ff41..46e8665945 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,7 +18,7 @@ - [ ] Added unit tests (if possible)? - [ ] Added XML documentation to any related classes? -- [ ] Consider submitting a PR to https://github.com/AvaloniaUI/Avaloniaui.net with user documentation +- [ ] Consider submitting a PR to https://github.com/AvaloniaUI/Documentation with user documentation ## Breaking changes diff --git a/native/Avalonia.Native/src/OSX/window.h b/native/Avalonia.Native/src/OSX/window.h index b1f64bca88..6a4ca2b8d8 100644 --- a/native/Avalonia.Native/src/OSX/window.h +++ b/native/Avalonia.Native/src/OSX/window.h @@ -34,6 +34,7 @@ class WindowBaseImpl; -(double) getScaling; -(double) getExtendedTitleBarHeight; -(void) setIsExtended:(bool)value; +-(void) updateShadow; @end struct INSWindowHolder diff --git a/native/Avalonia.Native/src/OSX/window.mm b/native/Avalonia.Native/src/OSX/window.mm index d7afbdaa3a..e7c144b2d3 100644 --- a/native/Avalonia.Native/src/OSX/window.mm +++ b/native/Avalonia.Native/src/OSX/window.mm @@ -124,7 +124,11 @@ public: [Window setTitle:_lastTitle]; _shown = true; - + + dispatch_async(dispatch_get_main_queue(), ^{ + [Window updateShadow]; + }); + return S_OK; } } @@ -1838,6 +1842,19 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent double _lastScaling; } +- (void)updateShadow +{ + // Common problem in Cocoa where [invalidateShadow] does work, + // This hack forces Cocoa to invalidate the shadow. + + NSRect frame = [self frame]; + NSRect updatedFrame = NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width + 1.0, frame.size.height + 1.0); + [self setFrame:updatedFrame display:YES]; + [self setFrame:frame display:YES]; + + [self invalidateShadow]; +} + -(void) setIsExtended:(bool)value; { _isExtended = value; diff --git a/samples/ControlCatalog/App.xaml.cs b/samples/ControlCatalog/App.xaml.cs index 020fb2fff3..f3ec7b48aa 100644 --- a/samples/ControlCatalog/App.xaml.cs +++ b/samples/ControlCatalog/App.xaml.cs @@ -39,6 +39,10 @@ namespace ControlCatalog public static Styles DefaultLight = new Styles { + new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog")) + { + Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/AccentColors.xaml") + }, new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog")) { Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/Base.xaml") @@ -60,6 +64,10 @@ namespace ControlCatalog public static Styles DefaultDark = new Styles { + new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog")) + { + Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/AccentColors.xaml") + }, new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog")) { Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/Base.xaml") diff --git a/samples/ControlCatalog/Pages/ViewboxPage.xaml b/samples/ControlCatalog/Pages/ViewboxPage.xaml index 6e649b39a5..ef802db33e 100644 --- a/samples/ControlCatalog/Pages/ViewboxPage.xaml +++ b/samples/ControlCatalog/Pages/ViewboxPage.xaml @@ -12,8 +12,9 @@ - + @@ -25,7 +26,7 @@ - + diff --git a/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs b/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs index 7a2bceb8f2..94b3f3ea14 100644 --- a/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs @@ -6,23 +6,18 @@ namespace ControlCatalog.Pages { public class ViewboxPage : UserControl { - private readonly Viewbox _viewbox; - private readonly ComboBox _stretchSelector; - public ViewboxPage() { InitializeComponent(); - _viewbox = this.FindControl("Viewbox"); - - _stretchSelector = this.FindControl("StretchSelector"); + var stretchSelector = this.FindControl("StretchSelector"); - _stretchSelector.Items = new[] + stretchSelector.Items = new[] { Stretch.Uniform, Stretch.UniformToFill, Stretch.Fill, Stretch.None }; - _stretchSelector.SelectedIndex = 0; + stretchSelector.SelectedIndex = 0; var stretchDirectionSelector = this.FindControl("StretchDirectionSelector"); @@ -38,10 +33,5 @@ namespace ControlCatalog.Pages { AvaloniaXamlLoader.Load(this); } - - private void StretchSelector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) - { - _viewbox.Stretch = (Stretch) _stretchSelector.SelectedItem!; - } } } diff --git a/samples/RenderDemo/Pages/AnimationsPage.xaml b/samples/RenderDemo/Pages/AnimationsPage.xaml index 12fb31ea59..21c7d68b5d 100644 --- a/samples/RenderDemo/Pages/AnimationsPage.xaml +++ b/samples/RenderDemo/Pages/AnimationsPage.xaml @@ -1,7 +1,8 @@ + x:Class="RenderDemo.Pages.AnimationsPage" + MaxWidth="600"> @@ -167,8 +168,8 @@ - - Hover to activate Transform Keyframe Animations. + + Hover to activate Keyframe Animations.