mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 10:30:48 +00:00
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:
parent
953db32805
commit
93988bdfbd
5 changed files with 90 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue