mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 03:20: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
|
@ -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…
Add table
Add a link
Reference in a new issue