Browse Source

Merge pull request #7148 from AvaloniaUI/fixes/allow-to-disable-menu

allow disabling of native menu export.
border-clip-test
Steven Kirk 4 years ago
committed by Dan Walmsley
parent
commit
08bc73e27d
  1. 7
      src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
  2. 5
      src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs

7
src/Avalonia.Native/AvaloniaNativeMenuExporter.cs

@ -144,6 +144,13 @@ namespace Avalonia.Native
private void DoLayoutReset(bool forceUpdate = false)
{
var macOpts = AvaloniaLocator.Current.GetService<MacOSPlatformOptions>();
if (macOpts != null && macOpts.DisableNativeMenus)
{
return;
}
if (_resetQueued || forceUpdate)
{
_resetQueued = false;

5
src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs

@ -73,5 +73,10 @@ namespace Avalonia
/// You can prevent Avalonia from adding those items to the OSX Application Menu with this property. The default value is false.
/// </summary>
public bool DisableDefaultApplicationMenuItems { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the native macOS menu bar will be enabled for the application.
/// </summary>
public bool DisableNativeMenus { get; set; }
}
}

Loading…
Cancel
Save