Changeset 344


Ignore:
Timestamp:
Jun 12, 2006, 11:36:25 PM (16 years ago)
Author:
livings124
Message:

This should make the borders of the new progress bar a bit more consistent.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.h

    r310 r344  
    4949    int     fStopRatioSetting;
    5050    float   fRatioLimit;
     51    BOOL    fFinishedSeeding;
    5152}
    5253
  • trunk/macosx/Torrent.m

    r310 r344  
    146146            [self stop];
    147147            [self setStopRatioSetting: RATIO_NO_CHECK];
     148            fFinishedSeeding = YES;
    148149           
    149150            fStat = tr_torrentStat( fHandle );
     
    165166    {
    166167        case TR_STATUS_PAUSE:
    167             [fStatusString setString: @"Paused"];
     168            [fStatusString setString: fFinishedSeeding ? @"Seeding Complete" : @"Paused"];
    168169            break;
    169170
     
    229230    {
    230231        tr_torrentStart( fHandle );
     232        fFinishedSeeding = NO;
    231233    }
    232234}
     
    551553
    552554    fDate = date ? [date retain] : [[NSDate alloc] init];
     555   
    553556    fStopRatioSetting = stopRatioSetting ? [stopRatioSetting intValue] : -1;
    554557    fRatioLimit = ratioLimit ? [ratioLimit floatValue] : [fDefaults floatForKey: @"RatioLimit"];
     558    fFinishedSeeding = NO;
    555559   
    556560    NSString * fileType = ( fInfo->fileCount > 1 ) ?
  • trunk/macosx/TorrentCell.m

    r342 r344  
    138138    else
    139139    {
     140        float completedWidth = [fTorrent progress] * width,
     141                remainingWidth = width - completedWidth;
     142   
    140143        NSImage * barActiveEnd, * barActive;
    141144        if ([fTorrent isActive])
     
    149152            barActive = fProgressGray;
    150153        }
    151        
    152         float completedWidth = [fTorrent progress] * width,
    153                 remainingWidth = width - completedWidth;
    154    
    155         if (completedWidth >= 1.0)
    156             [barActiveEnd compositeToPoint: point operation: NSCompositeSourceOver];
    157         else
    158             [fProgressEndWhite compositeToPoint: point operation: NSCompositeSourceOver];
     154        if (completedWidth < 1.0)
     155            barActiveEnd = fProgressEndWhite;
     156   
     157        [barActiveEnd compositeToPoint: point operation: NSCompositeSourceOver];
    159158       
    160159        point.x += 1.0;
     
    165164       
    166165        point.x += remainingWidth;
    167         [fProgressEndWhite compositeToPoint: point operation: NSCompositeSourceOver];
     166        [[fTorrent progress] < 1.0 ? fProgressEndWhite : fProgressEndGray
     167                    compositeToPoint: point operation: NSCompositeSourceOver];
    168168    }
    169169}
     
    249249   
    250250    //draw overlay over advanced bar
    251     [self placeBar: fProgressAdvanced width: width point: point];
     251    [fProgressEndAdvanced compositeToPoint: point operation: NSCompositeSourceOver];
     252   
     253    point.x += 1.0;
     254    [self placeBar: fProgressAdvanced width: width - 2.0 point: point];
     255   
     256    point.x += width - 2.0;
     257    [fProgressEndAdvanced compositeToPoint: point operation: NSCompositeSourceOver];
    252258}
    253259
Note: See TracChangeset for help on using the changeset viewer.