mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 17:52:42 +00:00
Added menu organization hooks
This commit is contained in:
parent
81b59ad0a0
commit
a9f33627f1
3 changed files with 29 additions and 0 deletions
|
@ -1531,6 +1531,18 @@ withRepeatedImage: (NSImage*)image
|
|||
- (NSString *) proposedTitle: (NSString *)title
|
||||
forMenuItem: (NSMenuItem *)menuItem;
|
||||
|
||||
/**
|
||||
* Used to determine whether or not the theme handles organizing the app's main
|
||||
* menu. The default implementation returns NO.
|
||||
*/
|
||||
- (BOOL) organizesMainMenu;
|
||||
|
||||
/**
|
||||
* Used by the theme to organize the main menu. The default implementation does
|
||||
* nothing, because it will never be called.
|
||||
*/
|
||||
- (void) organizeMainMenu: (NSMenu *)menu;
|
||||
|
||||
@end
|
||||
|
||||
@interface GSTheme (OpenSavePanels)
|
||||
|
|
|
@ -199,5 +199,14 @@
|
|||
return title;
|
||||
}
|
||||
|
||||
- (BOOL) organizesMainMenu
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) organizeMainMenu: (NSMenu *)menu
|
||||
{
|
||||
// Do nothing, just return.
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -265,6 +265,8 @@ static BOOL menuBarVisible = YES;
|
|||
NSString *servicesString = _(@"Services");
|
||||
int i;
|
||||
|
||||
|
||||
|
||||
if ([self _isMain])
|
||||
{
|
||||
NSString *appTitle;
|
||||
|
@ -280,6 +282,12 @@ static BOOL menuBarVisible = YES;
|
|||
appItem = [self itemWithTitle: appTitle];
|
||||
appMenu = [appItem submenu];
|
||||
|
||||
if ([[GSTheme theme] organizesMainMenu])
|
||||
{
|
||||
[[GSTheme theme] organizeMainMenu: self];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_menu.horizontal == YES)
|
||||
{
|
||||
NSMutableArray *itemsToMove;
|
||||
|
|
Loading…
Reference in a new issue