Changeset 150


Ignore:
Timestamp:
Mar 12, 2006, 3:28:31 PM (16 years ago)
Author:
titer
Message:

Started to restore the start/resume/reveal buttons

Location:
branches/new_api/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/new_api/macosx/TorrentCell.m

    r148 r150  
    125125
    126126    p   = (uint32_t *) [fBitmap bitmapData] + 1;
    127     end = lrintf( floor( [fTorrent progress] * fWidth ) );
     127    end = lrintf( floor( [fTorrent progress] * ( fWidth - 2 ) ) );
    128128
    129129    if( [fTorrent isSeeding] )
     
    229229- (void) buildBar
    230230{
    231     int h, w;
     231    int h;
    232232    uint32_t * p;
    233233
    234     /* Background */
     234    /* Left and right borders */
    235235    p = (uint32_t *) [fBitmap bitmapData];
    236236    for( h = 0; h < BAR_HEIGHT; h++ )
    237237    {
    238238        p[0] = kBorder[h];
    239         for( w = 1; w < fWidth - 1; w++ )
    240         {
    241             p[w] = kBack[h];
    242         }
    243239        p[fWidth - 1] = kBorder[h];
    244240        p += [fBitmap bytesPerRow] / 4;
     
    293289    NSString * sizeString = [NSString stringWithFormat: @" (%@)",
    294290        [NSString stringForFileSize: [fTorrent size]]];
    295     string = [[[fTorrent name] stringFittingInWidth: fWidth -
     291    string = [[[fTorrent name] stringFittingInWidth: fWidth - 40 -
    296292        [sizeString sizeWithAttributes: attributes].width
    297293        withAttributes: attributes] stringByAppendingString: sizeString];
  • branches/new_api/macosx/TorrentTableView.m

    r149 r150  
    5252    NSRect cellRect, rect;
    5353
    54     col      = [self columnWithIdentifier: @"Name"];
     54    col      = [self columnWithIdentifier: @"Torrent"];
    5555    cellRect = [self frameOfCellAtColumn: col row: row];
    56     rect     = NSMakeRect( cellRect.origin.x + cellRect.size.width - 19,
    57                            cellRect.origin.y + cellRect.size.height - 38,
    58                            14, 14 );
     56    rect     = NSMakeRect( cellRect.origin.x + cellRect.size.width - 39,
     57                           cellRect.origin.y + 3, 14, 14 );
    5958
    6059    return rect;
     
    6665    NSRect cellRect, rect;
    6766
    68     col      = [self columnWithIdentifier: @"Name"];
     67    col      = [self columnWithIdentifier: @"Torrent"];
    6968    cellRect = [self frameOfCellAtColumn: col row: row];
    70     rect     = NSMakeRect( cellRect.origin.x + cellRect.size.width - 19,
    71                            cellRect.origin.y + cellRect.size.height - 19,
    72                            14, 14 );
     69    rect     = NSMakeRect( cellRect.origin.x + cellRect.size.width - 20,
     70                           cellRect.origin.y + 3, 14, 14 );
    7371
    7472    return rect;
     
    148146    [super drawRect: r];
    149147
    150 #if 0
    151148    for( i = 0; i < [self numberOfRows]; i++ )
    152149    {
    153150        rect  = [self pauseRectForRow: i];
    154151        image = NULL;
     152#if 0
    155153        if( fStat[i].status & TR_STATUS_PAUSE )
    156154        {
     155#endif
    157156            image = NSPointInRect( fClickPoint, rect ) ?
    158157                [NSImage imageNamed: @"ResumeOn.png"] :
    159158                [NSImage imageNamed: @"ResumeOff.png"];
     159#if 0
    160160        }
    161161        else if( fStat[i].status &
     
    166166                [NSImage imageNamed: @"PauseOff.png"];
    167167        }
     168#endif
    168169        if( image )
    169170        {
    170             point = NSMakePoint( rect.origin.x, rect.origin.y + 14 );
    171             [image compositeToPoint: point operation: NSCompositeSourceOver];
     171            [image setFlipped: YES];
     172            [image drawAtPoint: rect.origin fromRect:
     173                NSMakeRect( 0, 0, 14, 14 ) operation:
     174                NSCompositeSourceOver fraction: 1.0];
    172175        }
    173176
     
    176179            [NSImage imageNamed: @"RevealOn.png"] :
    177180            [NSImage imageNamed: @"RevealOff.png"];
    178         point = NSMakePoint( rect.origin.x, rect.origin.y + 14 );
    179         [image compositeToPoint: point operation: NSCompositeSourceOver];
     181        [image setFlipped: YES];
     182        [image drawAtPoint: rect.origin fromRect:
     183            NSMakeRect( 0, 0, 14, 14 ) operation:
     184            NSCompositeSourceOver fraction: 1.0];
    180185    }
    181 #endif
    182186}
    183187
Note: See TracChangeset for help on using the changeset viewer.