Changeset 9723


Ignore:
Timestamp:
Dec 12, 2009, 3:11:48 AM (12 years ago)
Author:
livings124
Message:

dead code removal

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/FileNameCell.h

    r7659 r9723  
    3232}
    3333
     34- (NSRect) imageRectForBounds: (NSRect) bounds;
     35
    3436@end
  • trunk/macosx/FileNameCell.m

    r9320 r9723  
    121121}
    122122
    123 - (NSRect) titleRectForBounds: (NSRect) bounds
    124 {
    125     return [self rectForTitleWithString: [self attributedTitle] inBounds: bounds];
    126 }
    127 
    128 - (NSRect) statusRectForBounds: (NSRect) bounds
    129 {
    130     return [self rectForStatusWithString: [self attributedStatus]
    131             withTitleRect: [(FileListNode *)[self objectValue] isFolder] ? [self titleRectForBounds: bounds] : NSZeroRect
    132             inBounds: bounds];
    133 }
    134 
    135123- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
    136124{
  • trunk/macosx/TorrentCell.h

    r9321 r9723  
    3636
    3737- (NSRect) iconRectForBounds: (NSRect) bounds;
    38 - (NSRect) titleRectForBounds: (NSRect) bounds;
    39 - (NSRect) progressRectForBounds: (NSRect) bounds;
    40 - (NSRect) barRectForBounds: (NSRect) bounds;
    41 - (NSRect) statusRectForBounds: (NSRect) bounds;
    42 - (NSRect) minimalStatusRectForBounds: (NSRect) bounds;
    43 
    44 - (NSRect) controlButtonRectForBounds: (NSRect) bounds;
    45 - (NSRect) revealButtonRectForBounds: (NSRect) bounds;
    46 - (NSRect) actionButtonRectForBounds: (NSRect) bounds;
    4738
    4839- (void) addTrackingAreasForView: (NSView *) controlView inRect: (NSRect) cellFrame withUserInfo: (NSDictionary *) userInfo
  • trunk/macosx/TorrentCell.m

    r9595 r9723  
    7474- (NSRect) rectForProgressWithString: (NSAttributedString *) string inBounds: (NSRect) bounds;
    7575- (NSRect) rectForStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds;
     76- (NSRect) barRectForBounds: (NSRect) bounds;
     77
     78- (NSRect) controlButtonRectForBounds: (NSRect) bounds;
     79- (NSRect) revealButtonRectForBounds: (NSRect) bounds;
     80- (NSRect) actionButtonRectForBounds: (NSRect) bounds;
    7681
    7782- (NSAttributedString *) attributedTitle;
     
    114119- (NSRect) iconRectForBounds: (NSRect) bounds
    115120{
    116     CGFloat imageSize = [fDefaults boolForKey: @"SmallView"] ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG;
     121    const CGFloat imageSize = [fDefaults boolForKey: @"SmallView"] ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG;
    117122   
    118123    NSRect result = bounds;
     
    120125    result.origin.y += floor((result.size.height - imageSize) * 0.5);
    121126    result.size = NSMakeSize(imageSize, imageSize);
    122    
    123     return result;
    124 }
    125 
    126 - (NSRect) titleRectForBounds: (NSRect) bounds
    127 {
    128     return [self rectForTitleWithString: [self attributedTitle]
    129             basedOnMinimalStatusRect: [self minimalStatusRectForBounds: bounds] inBounds: bounds];
    130 }
    131 
    132 - (NSRect) minimalStatusRectForBounds: (NSRect) bounds
    133 {
    134     if (![fDefaults boolForKey: @"SmallView"])
    135         return NSZeroRect;
    136    
    137     return [self rectForMinimalStatusWithString: [self attributedStatusString: [self minimalStatusString]]
    138             inBounds: bounds];
    139 }
    140 
    141 - (NSRect) progressRectForBounds: (NSRect) bounds
    142 {
    143     if ([fDefaults boolForKey: @"SmallView"])
    144         return NSZeroRect;
    145    
    146     return [self rectForProgressWithString: [self attributedStatusString: [[self representedObject] progressString]]
    147             inBounds: bounds];
    148 }
    149 
    150 - (NSRect) barRectForBounds: (NSRect) bounds
    151 {
    152     const BOOL minimal = [fDefaults boolForKey: @"SmallView"];
    153    
    154     NSRect result = bounds;
    155     result.size.height = BAR_HEIGHT;
    156     result.origin.x += (minimal ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG) + PADDING_BETWEEN_IMAGE_AND_BAR;
    157    
    158     result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE;
    159     if (minimal)
    160         result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
    161     else
    162         result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
    163    
    164     result.size.width = floor(NSMaxX(bounds) - result.origin.x - PADDING_HORIZONTAL - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
    165    
    166     return result;
    167 }
    168 
    169 - (NSRect) statusRectForBounds: (NSRect) bounds
    170 {
    171     if ([fDefaults boolForKey: @"SmallView"])
    172         return NSZeroRect;
    173    
    174     return [self rectForStatusWithString: [self attributedStatusString: [self statusString]] inBounds: bounds];
    175 }
    176 
    177 - (NSRect) controlButtonRectForBounds: (NSRect) bounds
    178 {
    179     NSRect result = bounds;
    180     result.size.height = NORMAL_BUTTON_WIDTH;
    181     result.size.width = NORMAL_BUTTON_WIDTH;
    182     result.origin.x = NSMaxX(bounds) - 2.0f * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
    183    
    184     result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;
    185     if ([fDefaults boolForKey: @"SmallView"])
    186         result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
    187     else
    188         result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
    189    
    190     return result;
    191 }
    192 
    193 - (NSRect) revealButtonRectForBounds: (NSRect) bounds
    194 {
    195     NSRect result = bounds;
    196     result.size.height = NORMAL_BUTTON_WIDTH;
    197     result.size.width = NORMAL_BUTTON_WIDTH;
    198     result.origin.x = NSMaxX(bounds) - (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
    199    
    200     result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;
    201     if ([fDefaults boolForKey: @"SmallView"])
    202         result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
    203     else
    204         result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
    205    
    206     return result;
    207 }
    208 
    209 - (NSRect) actionButtonRectForBounds: (NSRect) bounds
    210 {
    211     NSRect result = [self iconRectForBounds: bounds];
    212     if (![fDefaults boolForKey: @"SmallView"])
    213     {
    214         result.origin.x += (result.size.width - ACTION_BUTTON_WIDTH) * 0.5f;
    215         result.origin.y += (result.size.height - ACTION_BUTTON_WIDTH) * 0.5f;
    216         result.size.width = ACTION_BUTTON_WIDTH;
    217         result.size.height = ACTION_BUTTON_WIDTH;
    218     }
    219127   
    220128    return result;
     
    758666}
    759667
     668- (NSRect) barRectForBounds: (NSRect) bounds
     669{
     670    const BOOL minimal = [fDefaults boolForKey: @"SmallView"];
     671   
     672    NSRect result = bounds;
     673    result.size.height = BAR_HEIGHT;
     674    result.origin.x += (minimal ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG) + PADDING_BETWEEN_IMAGE_AND_BAR;
     675   
     676    result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE;
     677    if (minimal)
     678        result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
     679    else
     680        result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
     681   
     682    result.size.width = floor(NSMaxX(bounds) - result.origin.x - PADDING_HORIZONTAL - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
     683   
     684    return result;
     685}
     686
     687- (NSRect) controlButtonRectForBounds: (NSRect) bounds
     688{
     689    NSRect result = bounds;
     690    result.size.height = NORMAL_BUTTON_WIDTH;
     691    result.size.width = NORMAL_BUTTON_WIDTH;
     692    result.origin.x = NSMaxX(bounds) - 2.0f * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
     693   
     694    result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;
     695    if ([fDefaults boolForKey: @"SmallView"])
     696        result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
     697    else
     698        result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
     699   
     700    return result;
     701}
     702
     703- (NSRect) revealButtonRectForBounds: (NSRect) bounds
     704{
     705    NSRect result = bounds;
     706    result.size.height = NORMAL_BUTTON_WIDTH;
     707    result.size.width = NORMAL_BUTTON_WIDTH;
     708    result.origin.x = NSMaxX(bounds) - (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
     709   
     710    result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;
     711    if ([fDefaults boolForKey: @"SmallView"])
     712        result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
     713    else
     714        result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
     715   
     716    return result;
     717}
     718
     719- (NSRect) actionButtonRectForBounds: (NSRect) bounds
     720{
     721    NSRect result = [self iconRectForBounds: bounds];
     722    if (![fDefaults boolForKey: @"SmallView"])
     723    {
     724        result.origin.x += (result.size.width - ACTION_BUTTON_WIDTH) * 0.5f;
     725        result.origin.y += (result.size.height - ACTION_BUTTON_WIDTH) * 0.5f;
     726        result.size.width = ACTION_BUTTON_WIDTH;
     727        result.size.height = ACTION_BUTTON_WIDTH;
     728    }
     729   
     730    return result;
     731}
     732
    760733- (NSAttributedString *) attributedTitle
    761734{
Note: See TracChangeset for help on using the changeset viewer.