mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Replace SetItemMark() with Cocoa code
Use of the (undocumented) NSMenuItemBullet was suggested by an Apple engineer and the consequences, if it is unavailable, are harmless.
This commit is contained in:
@@ -261,10 +261,10 @@ static void set_legacy_key_equivalent (MenuRef aMenu, UInt16 anIndex, std::strin
|
||||
|
||||
- (void)setModifiedState:(BOOL)flag
|
||||
{
|
||||
if(MenuRef menu = _NSGetCarbonMenu([self menu]))
|
||||
if(NSImage* image = [NSImage imageNamed:@"NSMenuItemBullet"])
|
||||
{
|
||||
MenuItemIndex itemIndex = [[self menu] indexOfItem:self] + 1;
|
||||
SetItemMark(menu, itemIndex, flag ? 0xA5 : noMark);
|
||||
[self setMixedStateImage:image];
|
||||
[self setState:NSMixedState];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user