Allow themes to override [NSMenu _isVisible] (#307)

The default implementation of `[NSMenu]` uses `_aWindow` and `_bWindow` to determine the visibility of the menu.  Not all themes use these windows to build a menu.  For example, the WinUXTheme will use Win32 APIs to build a menu.

Allow themes to override the value of `[NSMenu _isVisible]` by introducing a `[GSTheme proposedVisibility: (BOOL)visible forMenu: (NSMenu *) menu]` method.  The default implementation simply eturns the proposed visibility.
This commit is contained in:
Frederik Carlier 2024-10-27 22:02:20 +01:00 committed by GitHub
parent 9901bbcb4c
commit acf00ce5d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View file

@ -1569,6 +1569,12 @@ withRepeatedImage: (NSImage*)image
- (void) organizeMenu: (NSMenu *)menu
isHorizontal: (BOOL)horizontal;
/**
* Used by the theme to override the proposed menu visibility. The default
* implementation simply returns the proposed visibility unmodified.
*/
- (BOOL) proposedVisibility: (BOOL)visible
forMenu: (NSMenu *) menu;
@end
@interface GSTheme (OpenSavePanels)