Browse Source

allow disabling of osx menu export.

pull/7148/head
Dan Walmsley 4 years ago
parent
commit
048cf388bc
  1. 7
      src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
  2. 5
      src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs

7
src/Avalonia.Native/AvaloniaNativeMenuExporter.cs

@ -142,6 +142,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>
///
/// </summary>
public bool DisableNativeMenus { get; set; }
}
}

Loading…
Cancel
Save