mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
* Headers/Additions/GNUstepGUI/GSTheme.h: Added method to call
back menuHeightForWindow: * Source/GSThemeMenu.m: Added default implementation of menuHeightForWindow:. Default implementation returns NSMenuView menuBarHeight. * Source/GSWindowDecorationView.m: Use menuHeightForWindow: instead of getting it directly from the menu view. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29288 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6b20840967
commit
7a717734be
4 changed files with 43 additions and 8 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2010-01-15 13:08-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h: Added method to call
|
||||
back menuHeightForWindow:
|
||||
* Source/GSThemeMenu.m: Added default implementation of
|
||||
menuHeightForWindow:. Default implementation returns NSMenuView
|
||||
menuBarHeight.
|
||||
* Source/GSWindowDecorationView.m: Use menuHeightForWindow: instead
|
||||
of getting it directly from the menu view.
|
||||
|
||||
2010-01-14 Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/NSWindow.m (-_initBackendWindow): Raise an
|
||||
|
|
|
@ -987,6 +987,7 @@ withRepeatedImage: (NSImage*)image
|
|||
- (void) setMenu: (NSMenu *)menu
|
||||
forWindow: (NSWindow *)window;
|
||||
- (void) processCommand: (void *)context;
|
||||
- (float) menuHeightForWindow: (NSWindow *)window;
|
||||
@end
|
||||
|
||||
#endif /* OS_API_VERSION */
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <Foundation/NSString.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/NSMenuView.h>
|
||||
|
||||
#include <GNUstepGUI/GSTheme.h>
|
||||
#include <GNUstepGUI/GSWindowDecorationView.h>
|
||||
|
@ -83,5 +84,10 @@
|
|||
// this is only implemented when we handle native menus.
|
||||
// put code in here to handle commands from the native menu structure.
|
||||
}
|
||||
|
||||
- (float) menuHeightForWindow: (NSWindow *)window
|
||||
{
|
||||
return [NSMenuView menuBarHeight];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -138,7 +138,11 @@
|
|||
|
||||
if ([_window menu] != nil)
|
||||
{
|
||||
content.size.height -= [NSMenuView menuBarHeight];
|
||||
float menubarHeight = [[GSTheme theme]
|
||||
menuHeightForWindow:
|
||||
[self window]];
|
||||
|
||||
content.size.height -= menubarHeight;
|
||||
}
|
||||
|
||||
if ([tb isVisible])
|
||||
|
@ -158,7 +162,11 @@
|
|||
|
||||
if ([_window menu] != nil)
|
||||
{
|
||||
aRect.size.height += [NSMenuView menuBarHeight];
|
||||
float menubarHeight = [[GSTheme theme]
|
||||
menuHeightForWindow:
|
||||
[self window]];
|
||||
|
||||
aRect.size.height += menubarHeight;
|
||||
}
|
||||
|
||||
if ([tb isVisible])
|
||||
|
@ -229,8 +237,10 @@
|
|||
if (hasMenu)
|
||||
{
|
||||
NSMenuView *menuView;
|
||||
float menuBarHeight = [NSMenuView menuBarHeight];
|
||||
|
||||
float menuBarHeight = [[GSTheme theme]
|
||||
menuHeightForWindow:
|
||||
[self window]];
|
||||
|
||||
menuView = [[_window menu] menuRepresentation];
|
||||
[menuView setFrame: NSMakeRect(
|
||||
contentViewFrame.origin.x,
|
||||
|
@ -380,7 +390,11 @@
|
|||
contentYOrigin = NSMaxY(contentRect);
|
||||
if(hasMenu)
|
||||
{
|
||||
contentYOrigin -= [NSMenuView menuBarHeight];
|
||||
float menuBarHeight = [[GSTheme theme]
|
||||
menuHeightForWindow:
|
||||
[self window]];
|
||||
|
||||
contentYOrigin -= menuBarHeight;
|
||||
}
|
||||
|
||||
// Plug the toolbar view
|
||||
|
@ -430,8 +444,9 @@
|
|||
|
||||
- (void) addMenuView: (NSMenuView*)menuView
|
||||
{
|
||||
float menubarHeight = [NSMenuView menuBarHeight];
|
||||
|
||||
float menubarHeight = [[GSTheme theme]
|
||||
menuHeightForWindow:
|
||||
[self window]];
|
||||
hasMenu = YES;
|
||||
// Plug the menu view
|
||||
[menuView setFrame: NSMakeRect(
|
||||
|
@ -448,6 +463,9 @@
|
|||
{
|
||||
NSEnumerator *e = [[self subviews] objectEnumerator];
|
||||
NSView *v;
|
||||
float menubarHeight = [[GSTheme theme]
|
||||
menuHeightForWindow:
|
||||
[self window]];
|
||||
|
||||
while ((v = [e nextObject]) != nil)
|
||||
{
|
||||
|
@ -460,7 +478,7 @@
|
|||
hasMenu = NO;
|
||||
[RETAIN(v) removeFromSuperviewWithoutNeedingDisplay];
|
||||
|
||||
[self changeWindowHeight: -([NSMenuView menuBarHeight])];
|
||||
[self changeWindowHeight: -(menubarHeight)];
|
||||
return AUTORELEASE(v);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue