never return a separator as the highlighted item

This commit is contained in:
Klaas Pieter Annema
2011-07-07 18:33:00 +02:00
parent 5158540208
commit 63d208bf20
+9 -1
View File
@@ -869,7 +869,15 @@ var _CPMenuBarVisible = NO,
*/
- (CPMenuItem)highlightedItem
{
return _highlightedIndex >= 0 ? _items[_highlightedIndex] : nil;
if (_highlightedIndex <= 0)
return nil;
var highlightedItem = _items[_highlightedIndex];
if ([highlightedItem isSeparatorItem])
return nil;
return highlightedItem;
}
// Managing the Delegate