Fixed: a disabled CPMenuItem could still have a selected background

Previously it was possible to have a highlighted CPMenuItem for a disabled CPMenuItem. (To get that, select an item, close the menu, disabled the item manually and then open the menu again).
Now it is not possible to get this behavior.
This commit is contained in:
Alexandre Wilhelm committed 2013-08-15 17:15:51 -07:00
1 parent 1e7dd0dc59
commit ec4b348369
1 file changed
+3
+3
View File
@@ -166,6 +166,9 @@ var CPMenuItemStringRepresentationDictionary = @{
if (_isEnabled === isEnabled)
return;
if (!isEnabled && [self isHighlighted])
[_menu _highlightItemAtIndex:CPNotFound];
_isEnabled = !!isEnabled;
[_menuItemView setDirty];