mirror of
https://github.com/textmate/textmate.git
synced 2026-01-21 20:57:54 -05:00
Remove disableHighlight property from NSCell subclass
The desired rendering can be achieved without adding code to NSCell
This commit is contained in:
@@ -13,7 +13,6 @@ PUBLIC @interface OFBPathInfoCell : OakImageAndTextCell
|
||||
@property (nonatomic, assign) BOOL isOpen;
|
||||
@property (nonatomic, assign) BOOL isVisible;
|
||||
@property (nonatomic, assign) BOOL isLoading;
|
||||
@property (nonatomic, assign) BOOL disableHighlight;
|
||||
|
||||
- (NSRect)closeButtonRectInFrame:(NSRect)cellFrame;
|
||||
@end
|
||||
|
||||
@@ -97,15 +97,6 @@ static void DrawSpinner (NSRect cellFrame, BOOL isFlipped, NSColor* color, doubl
|
||||
return NSMouseInRect(mousePoint, [self closeButtonRectInFrame:cellFrame], controlView.isFlipped);
|
||||
}
|
||||
|
||||
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
|
||||
{
|
||||
BOOL wasHighlighted = self.isHighlighted;
|
||||
if(self.disableHighlight)
|
||||
self.highlighted = NO;
|
||||
[super drawInteriorWithFrame:cellFrame inView:controlView];
|
||||
self.highlighted = wasHighlighted;
|
||||
}
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
|
||||
{
|
||||
if([controlView respondsToSelector:@selector(indentationPerLevel)])
|
||||
|
||||
@@ -54,10 +54,6 @@
|
||||
|
||||
// ========================================
|
||||
|
||||
@interface NSCell (DisableHighlight)
|
||||
@property (nonatomic) BOOL disableHighlight;
|
||||
@end
|
||||
|
||||
@interface OakInactiveTableView ()
|
||||
@property (nonatomic) OakTextFieldMovementDelegate* textFieldMovementDelegate;
|
||||
@end
|
||||
@@ -66,8 +62,11 @@
|
||||
- (NSCell*)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row
|
||||
{
|
||||
NSCell* res = [super preparedCellAtColumn:column row:row];
|
||||
if([res respondsToSelector:@selector(setDisableHighlight:)])
|
||||
[res setDisableHighlight:[self.window isKeyWindow]];
|
||||
if(res.isHighlighted && [self.window isKeyWindow])
|
||||
{
|
||||
res.backgroundStyle = NSBackgroundStyleDark;
|
||||
res.highlighted = NO;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user