Changeset 10405


Ignore:
Timestamp:
Mar 20, 2010, 6:09:45 PM (12 years ago)
Author:
livings124
Message:

more adjustments to compact view

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.h

    r10398 r10405  
    3232            fHover, fHoverControl, fHoverReveal, fHoverAction;
    3333   
    34     NSColor * fBarBorderColor, * fBluePieceColor;
     34    NSColor * fBarBorderColor, * fBluePieceColor, * fBarMinimalBorderColor;
    3535}
    3636
  • trunk/macosx/TorrentCell.m

    r10403 r10405  
    113113       
    114114        fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain];
    115         #warning show border in compact view
    116115        fBarBorderColor = [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.2] retain];
     116        fBarMinimalBorderColor = [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.015] retain];
    117117    }
    118118        return self;
     
    504504   
    505505    const CGFloat piecesBarPercent = [(TorrentTableView *)[self controlView] piecesBarPercent];
    506     if (piecesBarPercent > 0.0 && ([NSApp isOnSnowLeopardOrBetter] || !minimal))
     506    if (piecesBarPercent > 0.0 && (!minimal || [NSApp isOnSnowLeopardOrBetter]))
    507507    {
    508508        NSRect piecesBarRect, regularBarRect;
     
    520520    }
    521521   
    522     if (!minimal)
    523     {
    524         [fBarBorderColor set];
    525         [NSBezierPath strokeRect: NSInsetRect(barRect, 0.5, 0.5)];
    526     }
     522    NSColor * borderColor = minimal ? fBarMinimalBorderColor : fBarBorderColor;
     523    [borderColor set];
     524    [NSBezierPath strokeRect: NSInsetRect(barRect, 0.5, 0.5)];
    527525}
    528526
     
    658656    result.size = [string size];
    659657   
    660     result.origin.x = NSMaxX(bounds) - (NSWidth(result) + PADDING_HORIZONTAL);
     658    result.origin.x = NSMaxX(bounds) - (NSWidth(result) + PADDING_HORIZONTAL * 2.0);
    661659    result.origin.y = NSMinY(bounds) + PADDING_ABOVE_MIN_STATUS;
    662660   
     
    713711- (NSRect) barRectForBounds: (NSRect) bounds
    714712{
     713    NSRect result;
    715714   
    716715    if ([fDefaults boolForKey: @"SmallView"])
    717         return NSInsetRect(bounds, 2.0, 2.0);
    718     else
    719     {
    720         NSRect result;
     716    {
     717        result.origin.x = NSMinX(bounds) + IMAGE_SIZE_MIN + PADDING_BETWEEN_IMAGE_AND_BAR;
     718        result.origin.y = NSMinY(bounds) + 3.0;
     719        result.size.height = NSHeight(bounds) - 2.0 * 3.0;
     720        result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL;
     721    }
     722    else
     723    {
    721724        result.size.height = BAR_HEIGHT;
    722725       
     
    727730        result.size.width = floor(NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL
    728731                            - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
    729        
    730         return result;
    731     }
     732    }
     733   
     734    return result;
    732735}
    733736
     
    739742    result.origin.x = NSMaxX(bounds) - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
    740743   
    741     result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE;
    742744    if (![fDefaults boolForKey: @"SmallView"])
    743         result.origin.y += HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5
     745        result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5
    744746                            + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
     747    else
     748    {
     749        #warning make constant
     750        result.origin.y = NSMinY(bounds) + 6.0;
     751        result.origin.x -= PADDING_HORIZONTAL;
     752    }
    745753   
    746754    return result;
     
    754762    result.origin.x = NSMaxX(bounds) - (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
    755763   
    756     result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE;
    757764    if (![fDefaults boolForKey: @"SmallView"])
    758         result.origin.y += HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5
     765        result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5
    759766                            + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
     767    else
     768    {
     769        #warning make constant
     770        result.origin.y = NSMinY(bounds) + 6.0;
     771        result.origin.x -= PADDING_HORIZONTAL;
     772    }
    760773   
    761774    return result;
Note: See TracChangeset for help on using the changeset viewer.