forked from laullon/gitx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitXTextFieldCell.m
More file actions
37 lines (29 loc) · 824 Bytes
/
GitXTextFieldCell.m
File metadata and controls
37 lines (29 loc) · 824 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
//
// GitXTextFieldCell.m
// GitX
//
// Created by Nathan Kinsinger on 8/27/10.
// Copyright 2010 Nathan Kinsinger. All rights reserved.
//
#import "GitXTextFieldCell.h"
#import "PBGitCommit.h"
#import "PBRefController.h"
@implementation GitXTextFieldCell
- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
// disables the cell's selection highlight
return nil;
}
- (NSMenu *)menuForEvent:(NSEvent *)anEvent inRect:(NSRect)cellFrame ofView:(NSTableView *)commitList
{
NSInteger rowIndex = [commitList rowAtPoint:(cellFrame.origin)];
NSArray *items = [contextMenuDelegate menuItemsForRow:rowIndex];
if (!items)
return nil;
NSMenu *menu = [[NSMenu alloc] init];
[menu setAutoenablesItems:NO];
for (NSMenuItem *item in items)
[menu addItem:item];
return menu;
}
@end