Changeset 678


Ignore:
Timestamp:
Jul 23, 2006, 7:22:24 PM (16 years ago)
Author:
livings124
Message:

simplify rect width and height measurements

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Badger.m

    r613 r678  
    9797           
    9898            //place badge
    99             [fBadge compositeToPoint: badgeRect.origin
    100                         operation: NSCompositeSourceOver];
     99            [fBadge compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver];
    101100           
    102101            //ignore shadow of badge when placing string
     
    106105           
    107106            //place badge text
    108             [self badgeString: [NSString stringWithInt: completed]
    109                         forRect: badgeRect];
     107            [self badgeString: [NSString stringWithInt: completed] forRect: badgeRect];
    110108                       
    111109            [dockIcon unlockFocus];
     
    144142        {
    145143            //place badge
    146             [fUploadBadge compositeToPoint: badgeRect.origin
    147                         operation: NSCompositeSourceOver];
     144            [fUploadBadge compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver];
    148145           
    149146            //place badge text
     
    162159       
    163160            //place badge
    164             [fDownloadBadge compositeToPoint: badgeRect.origin
    165                         operation: NSCompositeSourceOver];
     161            [fDownloadBadge compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver];
    166162           
    167163            //place badge text
  • trunk/macosx/Controller.m

    r676 r678  
    4848#define TORRENT_TABLE_VIEW_DATA_TYPE    @"TorrentTableViewDataType"
    4949
    50 #define ROW_HEIGHT_REGULAR 65.0
    51 #define ROW_HEIGHT_SMALL 40.0
     50#define ROW_HEIGHT_REGULAR  65.0
     51#define ROW_HEIGHT_SMALL    40.0
     52#define WINDOW_REGULAR_WIDTH       468.0
    5253
    5354#define WEBSITE_URL @"http://transmission.m0k.org/"
     
    151152   
    152153    [contentView addSubview: fFilterBar];
    153     [fFilterBar setFrameOrigin: NSMakePoint(0, [contentView frame].origin.y + [contentView frame].size.height)];
     154    [fFilterBar setFrameOrigin: NSMakePoint(0, NSMaxY([contentView frame]))];
    154155   
    155156    [self showFilterBar: [fDefaults boolForKey: @"FilterBar"] animate: NO];
     
    164165   
    165166    [contentView addSubview: fStatusBar];
    166     [fStatusBar setFrameOrigin: NSMakePoint(0, [contentView frame].origin.y + [contentView frame].size.height)];
     167    [fStatusBar setFrameOrigin: NSMakePoint(0, NSMaxY([contentView frame]))];
    167168    [self showStatusBar: [fDefaults boolForKey: @"StatusBar"] animate: NO];
    168169   
     
    21202121                    : [self windowFrameForAmount: [fFilteredTorrents count]];
    21212122   
    2122     frame.size.width = [fDefaults boolForKey: @"SmallView"] ? [fWindow minSize].width : 468.0;
     2123    frame.size.width = [fDefaults boolForKey: @"SmallView"] ? [fWindow minSize].width : WINDOW_REGULAR_WIDTH;
    21232124    return frame;
    21242125}
     
    21872188    //hide search filter if it overlaps filter buttons
    21882189    NSRect buttonFrame = [fPauseFilterButton frame];
    2189     if (buttonFrame.origin.x + buttonFrame.size.width + 2.0 > [fSearchFilterField frame].origin.x)
     2190    if (NSMaxX(buttonFrame) + 2.0 > [fSearchFilterField frame].origin.x)
    21902191    {
    21912192        if (![fSearchFilterField isHidden])
  • trunk/macosx/InfoWindowController.m

    r676 r678  
    218218            [fStateField setStringValue: [torrent stateString]];
    219219/*
    220             [fPercentField setStringValue: [NSString stringWithFormat:
    221                                             @"%.2f%%", 100.0 * [torrent progress]]];
     220            [fPercentField setStringValue: [NSString stringWithFormat: @"%.2f%%", 100.0 * [torrent progress]]];
    222221*/
    223222            int seeders = [torrent seeders], leechers = [torrent leechers];
  • trunk/macosx/TorrentCell.m

    r639 r678  
    368368       
    369369        //place status string
    370         pen.x = cellFrame.origin.x + cellFrame.size.width - PADDING - [statusString size].width;
     370        pen.x = NSMaxX(cellFrame) - PADDING - [statusString size].width;
    371371        pen.y += ([nameString size].height - [statusString size].height) * 0.5;
    372372       
  • trunk/macosx/TorrentTableView.m

    r557 r678  
    190190    float buttonToTop = [fDefaults boolForKey: @"SmallView"] ? BUTTON_TO_TOP_SMALL : BUTTON_TO_TOP_REGULAR;
    191191   
    192     return NSMakeRect(cellRect.origin.x + cellRect.size.width - AREA_CENTER - DISTANCE_FROM_CENTER - BUTTON_WIDTH,
     192    return NSMakeRect(NSMaxX(cellRect) - AREA_CENTER - DISTANCE_FROM_CENTER - BUTTON_WIDTH,
    193193                        cellRect.origin.y + buttonToTop, BUTTON_WIDTH, BUTTON_WIDTH);
    194194}
     
    200200    float buttonToTop = [fDefaults boolForKey: @"SmallView"] ? BUTTON_TO_TOP_SMALL : BUTTON_TO_TOP_REGULAR;
    201201   
    202     return NSMakeRect(cellRect.origin.x + cellRect.size.width - AREA_CENTER + DISTANCE_FROM_CENTER,
     202    return NSMakeRect(NSMaxX(cellRect) - AREA_CENTER + DISTANCE_FROM_CENTER,
    203203                        cellRect.origin.y + buttonToTop, BUTTON_WIDTH, BUTTON_WIDTH);
    204204}
Note: See TracChangeset for help on using the changeset viewer.