Changeset 146


Ignore:
Timestamp:
Mar 12, 2006, 2:37:53 AM (16 years ago)
Author:
titer
Message:

Progress bar fix

Location:
branches/new_api/macosx
Files:
3 edited

Legend:

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

    r144 r146  
    131131
    132132    p   = (uint32_t *) [fBitmap bitmapData] + 2;
    133     end = lrintf( floor( 0.5 /*fStat->progress*/ * fWidth ) );
     133    end = lrintf( floor( [fTorrent progress] * fWidth ) );
    134134
    135135    /*
     
    184184    p    = (uint32_t *) [fBitmap bitmapData];
    185185    p   += 2;
    186     end  = lrintf( floor( /*fStat->progress*/ 0.5 * fWidth ) );
     186    end  = lrintf( floor( [fTorrent progress] * fWidth ) );
    187187    for( h = 0; h < 2; h++ )
    188188    {
     
    310310
    311311    fWidth  = NSWidth( cellFrame ) - 14;
    312 
    313312    fBitmap = [[NSBitmapImageRep alloc]
    314313        initWithBitmapDataPlanes: nil pixelsWide: fWidth + 4
     
    316315        hasAlpha: YES isPlanar: NO colorSpaceName:
    317316        NSCalibratedRGBColorSpace bytesPerRow: 0 bitsPerPixel: 0];
    318     [self buildBar];
    319 
    320     /* Init an NSImage with our bitmap in order to draw it. We need to
    321        do this every time, or for some reason it won't draw if the
    322        display is set to thousands of colors when Transmission was
    323        started */
    324317    img = [[NSImage alloc] initWithSize: [fBitmap size]];
    325318    [img addRepresentation: fBitmap];
    326319    [img setFlipped: YES];
    327320
    328     /* Actually draw the bar */
     321    /* Draw the progress bar */
    329322    pen.x += 5; pen.y += 5;
     323    [self buildBar];
    330324    [img drawAtPoint: pen fromRect: NSMakeRect( 0, 0,
    331325            [img size].width, [img size].height )
  • branches/new_api/macosx/Torrent.h

    r144 r146  
    5555- (uint64_t)   size;
    5656
     57- (float)      progress;
    5758- (BOOL)       isActive;
    5859- (BOOL)       isPaused;
  • branches/new_api/macosx/Torrent.m

    r144 r146  
    220220}
    221221
     222- (float) progress
     223{
     224    return fStat->progress;
     225}
     226
    222227- (BOOL) isActive
    223228{
Note: See TracChangeset for help on using the changeset viewer.