mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Table cell: Use highlight color for key equivalent / tab trigger
Previously we would use highlight color if the table view was first responder. Now we use the highlight color if the cell’s background is set to NSBackgroundStyleDark, which then works when we use the cell in a table view which “shares focus” with a text or key equivalent field.
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
|
||||
HIRect bounds = { { NSMinX(podRect) - 5, NSMinY(podRect) }, { NSWidth(podRect), NSHeight(podRect) } };
|
||||
[[NSColor textColor] set];
|
||||
if([self isHighlighted] && ([[controlView window] firstResponder] == controlView || ([[[controlView window] firstResponder] respondsToSelector:@selector(delegate)] && [[[controlView window] firstResponder] performSelector:@selector(delegate)] == controlView)) && [[controlView window] isKeyWindow])
|
||||
if(self.backgroundStyle == NSBackgroundStyleDark)
|
||||
[[NSColor alternateSelectedControlTextColor] set];
|
||||
|
||||
CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
|
||||
@@ -73,7 +73,7 @@
|
||||
[pStyle setTabStops:@[ [[NSTextTab alloc] initWithType:NSRightTabStopType location:width], [[NSTextTab alloc] initWithType:NSLeftTabStopType location:width + 1] ]];
|
||||
[aStr addAttributes:@{ NSParagraphStyleAttributeName : pStyle } range:NSMakeRange(0, [aStr length])];
|
||||
|
||||
if([self isHighlighted] && ([[controlView window] firstResponder] == controlView || ([[[controlView window] firstResponder] respondsToSelector:@selector(delegate)] && [[[controlView window] firstResponder] performSelector:@selector(delegate)] == controlView)) && [[controlView window] isKeyWindow])
|
||||
if(self.backgroundStyle == NSBackgroundStyleDark)
|
||||
[aStr addAttributes:@{ NSForegroundColorAttributeName : [NSColor alternateSelectedControlTextColor] } range:NSMakeRange(0, [aStr length])];
|
||||
|
||||
NSRect triggerFrame;
|
||||
|
||||
Reference in New Issue
Block a user