Made separator menu item themable, by moving the drawing code from

NSMenuItemCell to a new method in GSThemeDrawing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34079 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
qmathe 2011-10-28 09:40:41 +00:00
parent 953db32805
commit 93988bdfbd
5 changed files with 90 additions and 28 deletions

View file

@ -753,34 +753,10 @@ static NSString *commandKeyString = @"#";
- (void) drawSeparatorItemWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
{
NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
if (style == NSMacintoshInterfaceStyle
|| style == NSWindows95InterfaceStyle)
{
NSBezierPath *path = [NSBezierPath bezierPath];
NSPoint start = NSMakePoint(3, cellFrame.size.height/2 +
cellFrame.origin.y);
NSPoint end = NSMakePoint(cellFrame.size.width - 3,
cellFrame.size.height/2 +
cellFrame.origin.y);
[[NSColor blackColor] set];
[path moveToPoint: start];
[path lineToPoint: end];
[path stroke];
/*
NSRect lineFrame = NSMakeRect(cellFrame.origin.x,
cellFrame.origin.y
+ cellFrame.size.height/2,
cellFrame.size.width,
1);
NSBox *line = [[NSBox alloc] initWithFrame: lineFrame];
[controlView addSubview:line];
RELEASE(line);
*/
}
[[GSTheme theme] drawSeparatorItemForMenuItemCell: self
withFrame: cellFrame
inView: controlView
isHorizontal: [_menuView isHorizontal]];
}
- (void) drawStateImageWithFrame: (NSRect)cellFrame