Changeset 12474


Ignore:
Timestamp:
May 30, 2011, 12:28:32 AM (10 years ago)
Author:
livings124
Message:

#4299 Don't color the entire row for file-level priorities

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/FileOutlineView.h

    r11617 r12474  
    3131    Torrent * fTorrent;
    3232   
    33     NSGradient * fHighPriorityGradient, * fLowPriorityGradient, * fMixedPriorityGradient;
    34    
    3533    NSInteger fMouseRow;
    3634}
  • trunk/macosx/FileOutlineView.m

    r12469 r12474  
    4747    [self setIndentationPerLevel: 14.0];
    4848   
    49     NSColor * endingColor = [NSColor colorWithCalibratedRed: 217.0/255.0 green: 250.0/255.0 blue: 211.0/255.0 alpha: 1.0];
    50     NSColor * beginningColor = [endingColor blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
    51     fHighPriorityGradient = [[NSGradient alloc] initWithStartingColor: beginningColor endingColor: endingColor];
    52    
    53     endingColor = [NSColor colorWithCalibratedRed: 255.0/255.0 green: 243.0/255.0 blue: 206.0/255.0 alpha: 1.0];
    54     beginningColor = [endingColor blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
    55     fLowPriorityGradient = [[NSGradient alloc] initWithStartingColor: beginningColor endingColor: endingColor];
    56    
    57     endingColor = [NSColor colorWithCalibratedRed: 225.0/255.0 green: 218.0/255.0 blue: 255.0/255.0 alpha: 1.0];
    58     beginningColor = [endingColor blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
    59     fMixedPriorityGradient = [[NSGradient alloc] initWithStartingColor: beginningColor endingColor: endingColor];
    60    
    6149    fMouseRow = -1;
    6250}
     
    6452- (void) dealloc
    6553{
    66     [fHighPriorityGradient release];
    67     [fLowPriorityGradient release];
    68     [fMixedPriorityGradient release];
    69    
    7054    [super dealloc];
    7155}
    7256
     57#warning needed?
    7358- (void) setTorrent: (Torrent *) torrent
    7459{
     
    178163}
    179164
    180 - (void) drawRow: (NSInteger) row clipRect: (NSRect) clipRect
    181 {
    182     if (![self isRowSelected: row])
    183     {
    184         NSIndexSet * indexes = [(FileListNode *)[self itemAtRow: row] indexes];
    185        
    186         if ([fTorrent checkForFiles: indexes] != NSOffState)
    187         {
    188             NSGradient * gradient = nil;
    189            
    190             NSSet * priorities = [fTorrent filePrioritiesForIndexes: indexes];
    191             const NSUInteger count = [priorities count];
    192             if (count == 1)
    193             {
    194                 switch ([[priorities anyObject] intValue])
    195                 {
    196                     case TR_PRI_LOW:
    197                         gradient = fLowPriorityGradient;
    198                         break;
    199                     case TR_PRI_HIGH:
    200                         gradient = fHighPriorityGradient;
    201                         break;
    202                 }
    203             }
    204             else if (count > 1)
    205                 gradient = fMixedPriorityGradient;
    206             else;
    207            
    208             if (gradient)
    209             {
    210                 NSRect rect = [self rectOfRow: row];
    211                 rect.size.height -= 1.0;
    212                 [gradient drawInRect: rect angle: 90];
    213             }
    214         }
    215     }
    216    
    217     [super drawRow: row clipRect: clipRect];
    218 }
    219 
    220165@end
Note: See TracChangeset for help on using the changeset viewer.