Ticket #1134: Colloquy-1134-take2.patch
| File Colloquy-1134-take2.patch, 3.1 kB (added by eschaton, 7 months ago) |
|---|
-
Views/JVSideOutlineView.m
old new 10 10 outData[i] = ( 1. - a ) * dark[i] + a * light[i]; 11 11 } 12 12 13 @interface NSOutlineView (InternalMethodsColloquyOverridesPreLeopard) 14 - (NSColor *)_highlightColorForCell:(NSCell *)cell; 15 - (void)_highlightRow:(int)row clipRect:(NSRect)clip; 16 @end 17 13 18 @implementation JVSideOutlineView 14 19 - (NSColor *) _highlightColorForCell:(NSCell *) cell { 20 if ((floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_4) && [NSOutlineView instancesRespondToSelector:@selector(_highlightColorForCell:)]) { 21 return [super _highlightColorForCell:cell]; 22 } 23 15 24 // return nil to prevent normal selection drawing 16 25 return nil; 17 26 } 18 27 19 28 - (void) _highlightRow:(int) row clipRect:(NSRect) clip { 29 if ((floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_4) && [NSOutlineView instancesRespondToSelector:@selector(_highlightRow:clipRect:)]) { 30 [super _highlightRow:row clipRect:clip]; 31 return; 32 } 33 20 34 NSRect highlight = [self rectOfRow:row]; 21 35 22 36 struct CGFunctionCallbacks callbacks = { 0, gradientInterpolate, NULL }; … … 41 55 } 42 56 43 57 - (void) drawBackgroundInClipRect:(NSRect) clipRect { 58 if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_4) { 59 [super drawBackgroundInClipRect:clipRect]; 60 return; 61 } 62 44 63 static NSColor *backgroundColor = nil; 45 64 if( ! backgroundColor ) 46 65 backgroundColor = [[NSColor colorWithCalibratedRed:( 229. / 255. ) green:( 237. / 255. ) blue:( 247. / 255. ) alpha:1.] retain]; -
Controllers/JVChatWindowController.m
old new 12 12 NSString *JVToolbarToggleChatDrawerItemIdentifier = @"JVToolbarToggleChatDrawerItem"; 13 13 NSString *JVChatViewPboardType = @"Colloquy Chat View v1.0 pasteboard type"; 14 14 15 #pragma mark - 16 17 #if !defined(MAC_OS_X_VERSION_10_5) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) 18 19 enum { 20 NSTableViewSelectionHighlightStyleRegular = 0, 21 NSTableViewSelectionHighlightStyleSourceList = 1, 22 }; 23 typedef int NSTableViewSelectionHighlightStyle; 24 25 @interface NSTableView (LeopardMethodsForBuildingWithPreLeopardSDK) 26 - (void)setSelectionHighlightStyle:(NSTableViewSelectionHighlightStyle)value; 27 - (NSTableViewSelectionHighlightStyle)selectionHighlightStyle; 28 @end 29 #endif 30 15 31 @interface NSToolbar (NSToolbarPrivate) 16 32 - (NSView *) _toolbarView; 17 33 @end … … 72 88 [chatViewsOutlineView registerForDraggedTypes:[NSArray arrayWithObjects:JVChatViewPboardType, NSFilenamesPboardType, nil]]; 73 89 [chatViewsOutlineView setMenu:[[[NSMenu allocWithZone:nil] initWithTitle:@""] autorelease]]; 74 90 91 if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_4) { 92 [chatViewsOutlineView setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList]; 93 } 94 75 95 [favoritesButton setMenu:[MVConnectionsController favoritesMenu]]; 76 96 77 97 [self setShouldCascadeWindows:NO];
