mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 16:00:37 +00:00
Improved the menu theming to support some common menu look variations.
Fixed bug #34792 too. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34174 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c387e7ad6e
commit
effd2e71de
5 changed files with 268 additions and 53 deletions
|
@ -163,6 +163,7 @@ static NSString *commandKeyString = @"#";
|
|||
state = GSThemeSelectedState;
|
||||
}
|
||||
|
||||
// TODO: Make the color lookup simpler.
|
||||
color = [[GSTheme theme] colorNamed: @"NSMenuItem" state: state];
|
||||
if (color == nil)
|
||||
{
|
||||
|
@ -172,7 +173,7 @@ static NSString *commandKeyString = @"#";
|
|||
}
|
||||
else
|
||||
{
|
||||
color = [NSColor controlBackgroundColor];
|
||||
color = [[GSTheme theme] menuItemBackgroundColor];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -657,11 +658,7 @@ static NSString *commandKeyString = @"#";
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Drawing.
|
||||
//
|
||||
- (void) drawBorderAndBackgroundWithFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView
|
||||
- (GSThemeControlState) themeControlState
|
||||
{
|
||||
unsigned mask;
|
||||
GSThemeControlState state = GSThemeNormalState;
|
||||
|
@ -695,10 +692,19 @@ static NSString *commandKeyString = @"#";
|
|||
state = GSThemeSelectedState;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
//
|
||||
// Drawing.
|
||||
//
|
||||
- (void) drawBorderAndBackgroundWithFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView
|
||||
{
|
||||
[[GSTheme theme] drawBorderAndBackgroundForMenuItemCell: self
|
||||
withFrame: cellFrame
|
||||
inView: controlView
|
||||
state: state
|
||||
state: [self themeControlState]
|
||||
isHorizontal: [_menuView isHorizontal]];
|
||||
}
|
||||
|
||||
|
@ -792,8 +798,11 @@ static NSString *commandKeyString = @"#";
|
|||
- (void) drawTitleWithFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView
|
||||
{
|
||||
[self _drawText: [_menuItem title]
|
||||
inFrame: [self titleRectForBounds: cellFrame]];
|
||||
[[GSTheme theme] drawTitleForMenuItemCell: self
|
||||
withFrame: cellFrame
|
||||
inView: controlView
|
||||
state: [self themeControlState]
|
||||
isHorizontal: [_menuView isHorizontal]];
|
||||
}
|
||||
|
||||
- (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue