mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 17:32:03 +00:00
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:
parent
9901bbcb4c
commit
acf00ce5d2
3 changed files with 14 additions and 1 deletions
|
@ -383,7 +383,8 @@ static BOOL menuBarVisible = YES;
|
|||
|
||||
- (BOOL) _isVisible
|
||||
{
|
||||
return [_aWindow isVisible] || [_bWindow isVisible];
|
||||
BOOL isVisible = [_aWindow isVisible] || [_bWindow isVisible];
|
||||
return [[GSTheme theme] proposedVisibility: isVisible forMenu: self];
|
||||
}
|
||||
|
||||
- (BOOL) _isMain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue