diff --git a/ChangeLog b/ChangeLog index 9a8169c56..2d410dd26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-16 Richard Frith-Macdoanld + + * Source/NSMenuItemCell.m: fixup glitch with drawing of horizontal + menu items overwriting menu border. + * Source/NSMenuView.m: use menubar font size to calculate menubar + height. + 2007-02-16 Sergii Stoian * Headers/AppKit/NSTextView.h: Enable disabled insertion point diff --git a/Source/NSMenuItemCell.m b/Source/NSMenuItemCell.m index 074bce1f2..5a52f9b49 100644 --- a/Source/NSMenuItemCell.m +++ b/Source/NSMenuItemCell.m @@ -530,7 +530,10 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */ { if ([_menuView isHorizontal] == YES) { - // FIXME: No idea why this adjustment is needed. + /* A horizontal menu does not have borders drawn by the cell, + * but it does have a border round the menu as a whole, so we + * must inset from that. + */ return NSMakeRect (theRect.origin.x, theRect.origin.y + 2, theRect.size.width, theRect.size.height - 2); } @@ -585,6 +588,14 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */ - (void) drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { + if ([_menuView isHorizontal] == YES) + { + cellFrame = [self drawingRectForBounds: cellFrame]; + [[self backgroundColor] set]; + NSRectFill(cellFrame); + return; + } + // Set cell's background color [[self backgroundColor] set]; NSRectFill(cellFrame); diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index f1f45f2f3..f37e2432a 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -132,7 +132,7 @@ _addLeftBorderOffsetToRect(NSRect aRect) if (height == 0.0) { - NSFont *font = [NSFont menuFontOfSize: 0.0]; + NSFont *font = [NSFont menuBarFontOfSize: 0.0]; height = [font boundingRectForFont].size.height; if (height < 22) @@ -911,8 +911,6 @@ _addLeftBorderOffsetToRect(NSRect aRect) aRect = GSIArrayItemAtIndex(cellRects, index).ext; - /* FIXME: handle vertical case? */ - return aRect.rect; } else