mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:50:48 +00:00
* Source/NSMenu.m: Do not show the menu at the top of the screen in
NSWindows95InterfaceStyle mode. NOTE: This is the first half of the commits for the in-window menu changes. The next change will entail regenerating the menu for each window. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29210 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
acc5451a23
commit
51a01681c5
2 changed files with 30 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-01-05 03:39-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSMenu.m: Do not show the menu at the top of the screen in
|
||||||
|
NSWindows95InterfaceStyle mode.
|
||||||
|
|
||||||
2010-01-04 00:25-EST Gregory John Casamento <greg.casamento@gmail.com>
|
2010-01-04 00:25-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* Source/GSWindowDecorationView.[hm]: Addition of ivars to track
|
* Source/GSWindowDecorationView.[hm]: Addition of ivars to track
|
||||||
|
|
|
@ -108,6 +108,9 @@
|
||||||
|
|
||||||
/* Subclass of NSPanel since menus cannot become key */
|
/* Subclass of NSPanel since menus cannot become key */
|
||||||
@interface NSMenuPanel : NSPanel
|
@interface NSMenuPanel : NSPanel
|
||||||
|
{
|
||||||
|
NSMenu *_the_menu;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSMenuView (GNUstepPrivate)
|
@interface NSMenuView (GNUstepPrivate)
|
||||||
|
@ -133,6 +136,11 @@ static BOOL menuBarVisible = YES;
|
||||||
|
|
||||||
|
|
||||||
@implementation NSMenuPanel
|
@implementation NSMenuPanel
|
||||||
|
- (void) _setmenu: (NSMenu *)menu
|
||||||
|
{
|
||||||
|
_the_menu = menu;
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) canBecomeKeyWindow
|
- (BOOL) canBecomeKeyWindow
|
||||||
{
|
{
|
||||||
/* See [NSWindow-_lossOfKeyOrMainWindow] */
|
/* See [NSWindow-_lossOfKeyOrMainWindow] */
|
||||||
|
@ -140,6 +148,20 @@ static BOOL menuBarVisible = YES;
|
||||||
return YES;
|
return YES;
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) orderFrontRegardless
|
||||||
|
{
|
||||||
|
NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
|
||||||
|
if (style == NSWindows95InterfaceStyle)
|
||||||
|
{
|
||||||
|
// if we're the top level menu in Windows mode, don't show it.
|
||||||
|
if([_the_menu supermenu] == nil)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[super orderFrontRegardless];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSMenu (GNUstepPrivate)
|
@implementation NSMenu (GNUstepPrivate)
|
||||||
|
@ -185,6 +207,7 @@ static BOOL menuBarVisible = YES;
|
||||||
[win setLevel: NSSubmenuWindowLevel];
|
[win setLevel: NSSubmenuWindowLevel];
|
||||||
[win setWorksWhenModal: NO];
|
[win setWorksWhenModal: NO];
|
||||||
[win setBecomesKeyOnlyIfNeeded: YES];
|
[win setBecomesKeyOnlyIfNeeded: YES];
|
||||||
|
[win _setmenu: self];
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
@ -1328,10 +1351,12 @@ static BOOL menuBarVisible = YES;
|
||||||
* menu, we will still have it recorded as ours, but it won't be
|
* menu, we will still have it recorded as ours, but it won't be
|
||||||
* in our view hierarchy, so we have to re-add it.
|
* in our view hierarchy, so we have to re-add it.
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
if (contentView != [menuRep superview])
|
if (contentView != [menuRep superview])
|
||||||
{
|
{
|
||||||
[contentView addSubview: menuRep];
|
[contentView addSubview: menuRep];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue