Changeset 3777

Show
Ignore:
Timestamp:
02/06/08 09:04:24 (6 months ago)
Author:
timothy
Message:

Use correct source list style on Leopard. Patch by eschaton. #1134

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Controllers/JVChatWindowController.m

    r3718 r3777  
    1212NSString *JVToolbarToggleChatDrawerItemIdentifier = @"JVToolbarToggleChatDrawerItem"; 
    1313NSString *JVChatViewPboardType = @"Colloquy Chat View v1.0 pasteboard type"; 
     14 
     15#if !defined(MAC_OS_X_VERSION_10_5) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) 
     16enum { 
     17        NSTableViewSelectionHighlightStyleRegular = 0, 
     18        NSTableViewSelectionHighlightStyleSourceList = 1, 
     19}; 
     20 
     21typedef int NSTableViewSelectionHighlightStyle; 
     22 
     23@interface NSTableView (NewLeopardMethods) 
     24- (void) setSelectionHighlightStyle:(NSTableViewSelectionHighlightStyle) value; 
     25- (NSTableViewSelectionHighlightStyle) selectionHighlightStyle; 
     26@end 
     27#endif 
     28 
     29#pragma mark - 
    1430 
    1531@interface NSToolbar (NSToolbarPrivate) 
     
    7288        [chatViewsOutlineView registerForDraggedTypes:[NSArray arrayWithObjects:JVChatViewPboardType, NSFilenamesPboardType, nil]]; 
    7389        [chatViewsOutlineView setMenu:[[[NSMenu allocWithZone:nil] initWithTitle:@""] autorelease]]; 
     90 
     91        if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_4 ) 
     92                [chatViewsOutlineView setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList]; 
    7493 
    7594        [favoritesButton setMenu:[MVConnectionsController favoritesMenu]]; 
  • trunk/Views/JVSideOutlineView.m

    r3259 r3777  
    1111} 
    1212 
     13@interface NSOutlineView (NSOutlineViewPrivate) 
     14- (NSColor *) _highlightColorForCell:(NSCell *) cell; 
     15- (void) _highlightRow:(int) row clipRect:(NSRect) clip; 
     16@end 
     17 
    1318@implementation JVSideOutlineView 
    1419- (NSColor *) _highlightColorForCell:(NSCell *) cell { 
     20        if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_4 && [super respondsToSelector:_cmd] ) 
     21                return [super _highlightColorForCell:cell]; 
     22 
    1523    // return nil to prevent normal selection drawing 
    1624    return nil; 
     
    1826 
    1927- (void) _highlightRow:(int) row clipRect:(NSRect) clip { 
     28        if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_4 && [super respondsToSelector:_cmd] ) 
     29                return [super _highlightRow:row clipRect:clip]; 
     30 
    2031        NSRect highlight = [self rectOfRow:row]; 
    2132 
     
    4253 
    4354- (void) drawBackgroundInClipRect:(NSRect) clipRect { 
     55        if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_4 && [super respondsToSelector:_cmd] ) 
     56                return [super drawBackgroundInClipRect:clipRect]; 
     57 
    4458        static NSColor *backgroundColor = nil; 
    4559        if( ! backgroundColor ) 
    4660                backgroundColor = [[NSColor colorWithCalibratedRed:( 229. / 255. ) green:( 237. / 255. ) blue:( 247. / 255. ) alpha:1.] retain]; 
     61 
    4762        [backgroundColor set]; 
    4863        NSRectFill( clipRect );