blob: e0f36a72c92e7070f7e125b6367aad6334808b75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "chrome/browser/cocoa/autoseparating_menu.h"
@implementation AutoseparatingMenu
- (NSMenuItem *)insertItemWithTitle:(NSString *)aString
action:(SEL)aSelector
keyEquivalent:(NSString *)keyEquiv
atIndex:(NSInteger)index {
if ([aString isEqualToString:@"-"]) {
NSMenuItem* separator = [NSMenuItem separatorItem];
[self insertItem:separator
atIndex:index];
return separator;
} else {
return [super insertItemWithTitle:aString
action:aSelector
keyEquivalent:keyEquiv
atIndex:index];
}
}
@end
|