Fix for disabled menu items still highlighting

Signed-off-by: 280north <admin+280north@280north.com>
This commit is contained in:
Nicholas Small authored and 280north committed 2009-01-05 07:50:30 +08:00
1 parent 67658876d5
commit 78503a9380
1 file changed
+17 -14
+17 -14
View File
@@ -1066,23 +1066,26 @@ var _CPMenuItemSelectionColor = nil,
else
{
[_imageAndTitleView setTextColor:shouldHighlight ? [CPColor whiteColor] : [self textColor]];
if (shouldHighlight)
[self setBackgroundColor:_CPMenuItemSelectionColor];
else
[self setBackgroundColor:nil];
var state = [_menuItem state];
switch (state)
if([_menuItem isEnabled])
{
case CPOffState:
case CPOnState:
case CPMixedState: [_stateView setImage:shouldHighlight ? _CPMenuItemDefaultStateHighlightedImages[state] : _CPMenuItemDefaultStateImages[state]];
[_imageAndTitleView setTextColor:shouldHighlight ? [CPColor whiteColor] : [self textColor]];
if (shouldHighlight)
[self setBackgroundColor:_CPMenuItemSelectionColor];
else
[self setBackgroundColor:nil];
var state = [_menuItem state];
switch (state)
{
case CPOffState:
case CPOnState:
case CPMixedState: [_stateView setImage:shouldHighlight ? _CPMenuItemDefaultStateHighlightedImages[state] : _CPMenuItemDefaultStateImages[state]];
break;
default: [_stateView setImage:nil];
default: [_stateView setImage:nil];
}
}
}
}