Changeset 10426


Ignore:
Timestamp:
Mar 28, 2010, 1:29:40 AM (12 years ago)
Author:
livings124
Message:

still show the progress bar in compact view for selected rows

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/ProgressGradients.m

    r10411 r10426  
    2929+ (NSGradient *) progressGradientForRed: (CGFloat) redComponent green: (CGFloat) greenComponent blue: (CGFloat) blueComponent
    3030{
    31     const CGFloat alpha = [[NSUserDefaults standardUserDefaults] boolForKey: @"SmallView"] ? 0.265 : 1.0;
     31    const CGFloat alpha = [[NSUserDefaults standardUserDefaults] boolForKey: @"SmallView"] ? 0.28 : 1.0;
    3232   
    3333    NSColor * baseColor = [NSColor colorWithCalibratedRed: redComponent green: greenComponent blue: blueComponent alpha: alpha];
  • trunk/macosx/TorrentCell.m

    r10413 r10426  
    7272- (NSRect) rectForProgressWithStringInBounds: (NSRect) bounds;
    7373- (NSRect) rectForStatusWithStringInBounds: (NSRect) bounds;
    74 - (NSRect) barRectForBounds: (NSRect) bounds;
     74- (NSRect) barRectRegForBounds: (NSRect) bounds;
     75- (NSRect) barRectMinForBounds: (NSRect) bounds;
    7576
    7677- (NSRect) controlButtonRectForBounds: (NSRect) bounds;
     
    331332   
    332333    //bar
    333     if (!minimal || ![self isHighlighted])
    334         [self drawBar: [self barRectForBounds: cellFrame]];
     334    [self drawBar: minimal ? [self barRectMinForBounds: cellFrame] : [self barRectRegForBounds: cellFrame]];
    335335   
    336336    //group coloring
     
    724724}
    725725
    726 - (NSRect) barRectForBounds: (NSRect) bounds
     726- (NSRect) barRectRegForBounds: (NSRect) bounds
    727727{
    728728    NSRect result;
    729    
    730     if ([fDefaults boolForKey: @"SmallView"])
    731     {
    732         result.origin.x = NSMinX(bounds) + IMAGE_SIZE_MIN + PADDING_BETWEEN_IMAGE_AND_BAR;
    733         result.origin.y = NSMinY(bounds) + PADDING_BETWEEN_BAR_AND_EDGE_MIN;
    734         result.size.height = NSHeight(bounds) - 2.0 * PADDING_BETWEEN_BAR_AND_EDGE_MIN;
    735         result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL;
    736     }
    737     else
    738     {
    739         result.size.height = BAR_HEIGHT;
    740        
    741         result.origin.x = NSMinX(bounds) + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_BAR;
    742         result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS
    743                             + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
    744        
    745         result.size.width = floor(NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL
    746                             - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
    747     }
     729    result.size.height = BAR_HEIGHT;
     730    result.origin.x = NSMinX(bounds) + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_BAR;
     731    result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS
     732                        + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
     733   
     734    result.size.width = floor(NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL
     735                        - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
     736   
     737    return result;
     738}
     739
     740- (NSRect) barRectMinForBounds: (NSRect) bounds
     741{
     742    NSRect result;
     743    result.origin.x = NSMinX(bounds) + IMAGE_SIZE_MIN + PADDING_BETWEEN_IMAGE_AND_BAR;
     744    result.origin.y = NSMinY(bounds) + PADDING_BETWEEN_BAR_AND_EDGE_MIN;
     745    result.size.height = NSHeight(bounds) - 2.0 * PADDING_BETWEEN_BAR_AND_EDGE_MIN;
     746    result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL;
    748747   
    749748    return result;
Note: See TracChangeset for help on using the changeset viewer.