Changeset 432 for trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.m
- Timestamp:
- 03/03/08 08:59:32 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.