- Timestamp:
- 03/03/08 08:59:32 (17 years ago)
- Location:
- trunk/ICeCoffEE/ICeCoffEE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEInvertingTextFieldCell.m
r428 r432 8 8 9 9 #import "ICeCoffEEInvertingTextFieldCell.h" 10 #import "ICeCoffEEMenuOutlineView.h" 10 11 11 12 … … 19 20 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; 20 21 { 21 if ([self isHighlighted] && [[controlView window] firstResponder] == controlView && [[controlView window] isKeyWindow]) { 22 // XXX note cast to ICeCoffEEMenuOutlineView *; this is not general-purpose 23 if ([self isHighlighted] && [(ICeCoffEEMenuOutlineView *)controlView shouldUseActiveHighlight]) { 22 24 NSMutableAttributedString *astr = [[self attributedStringValue] mutableCopy]; 23 25 unsigned location = 0, length = [astr length]; -
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.h
r428 r432 11 11 12 12 @interface ICeCoffEEMenuOutlineView : NSOutlineView { 13 13 NSWindow *mainWindow; // not retained 14 14 } 15 15 16 - (BOOL)shouldUseActiveHighlight; 17 16 18 @end -
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.m
r429 r432 18 18 } 19 19 20 // maintains main window (e.g., window to which sheet is attached) for use by shouldUseActiveHighlight 21 - (void)viewDidMoveToWindow; 22 { 23 mainWindow = [NSApp mainWindow]; 24 [super viewDidMoveToWindow]; 25 } 26 27 - (BOOL)shouldUseActiveHighlight; 28 { 29 return NO; 30 // test cases: - XXX there should be a better way to do this 31 // see <http://lists.apple.com/archives/cocoa-dev/2008/Mar/msg00036.html> 32 // - About System Preferences... 33 // - focused character palette 34 // - Help menu search (Shortcut) 35 // - menu extras 36 NSWindow *keyWindow = [NSApp keyWindow], *thisWindow = [self window]; 37 if (keyWindow != thisWindow && [keyWindow isKindOfClass: [NSPanel class]]) 38 return NO; // exclude NSCarbonMenuWindow 39 return [thisWindow firstResponder] == self && [NSApp mainWindow] == mainWindow; 40 } 41 20 42 - (void)highlightSelectionInClipRect:(NSRect)clipRect; 21 43 { … … 24 46 25 47 HIThemeMenuItemDrawInfo drawInfo = {0, kThemeMenuItemHierBackground | kThemeMenuItemPopUpBackground, kThemeMenuSelected}; 26 if ([[self window] firstResponder] != self || [NSApp keyWindow] != [self window]) { 27 NSLog(@"firstResponder %@ key %@ main %@ this %@", [[self window] firstResponder], [NSApp keyWindow], [NSApp mainWindow], [self window]); 48 NSLog(@"firstResponder %@ key %@ isKey %d main %@", [[self window] firstResponder], [NSApp keyWindow], [[self window] isKeyWindow], [NSApp mainWindow]); 49 if (![self shouldUseActiveHighlight]) { 50 instrumentObjcMessageSends(YES); 28 51 [super highlightSelectionInClipRect: clipRect]; 52 instrumentObjcMessageSends(NO); 29 53 return; 30 54 } -
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEServicePrefController.m
r431 r432 10 10 #import "ICeCoffEEServices.h" 11 11 #import "ICeCoffEEServicePrefController.h" 12 #import "ICeCoffEEMenuOutlineView.h" 12 13 #import "ICeCoffEENonHighlightingButtonCell.h" 13 14 #import "ICeCoffEEInvertingTextFieldCell.h" … … 477 478 478 479 if (![outlineView isRowSelected: [outlineView rowForItem: item]] || 479 [[outlineView window] firstResponder] != outlineView || ![[outlineView window] isKeyWindow]) {480 ![(ICeCoffEEMenuOutlineView *)outlineView shouldUseActiveHighlight]) { 480 481 if (!isInverted) 481 482 return;
Note:
See TracChangeset
for help on using the changeset viewer.