Browse Source
Merge pull request #7148 from AvaloniaUI/fixes/allow-to-disable-menu
allow disabling of native menu export.
pull/7248/head
Steven Kirk
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
0 deletions
-
src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
-
src/Avalonia.Native/AvaloniaNativePlatformExtensions.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; |
|
|
|
|
|
|
|
@ -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; } |
|
|
|
} |
|
|
|
} |
|
|
|
|