Changeset 2087


Ignore:
Timestamp:
Jun 16, 2007, 1:39:53 AM (15 years ago)
Author:
livings124
Message:

dim the part of the progress bar that shouldn't download (yes, the color is 100% percent temporary until someone makes one that matches :-p)

Location:
branches/file_selection/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/macosx/Torrent.m

    r2085 r2087  
    547547                                    [NSNumber numberWithBool: [self isSeeding]], @"Seeding",
    548548                                    [NSNumber numberWithFloat: [self progress]], @"Progress",
     549                                    [NSNumber numberWithFloat: (float)fStat->left/[self size]], @"Left",
    549550                                    [NSNumber numberWithBool: [self isActive]], @"Active",
    550551                                    [NSNumber numberWithBool: [self isError]], @"Error", nil];
    551552   
    552553    if ([self isSeeding])
    553     {
    554554        [info setObject: [NSNumber numberWithFloat: [self progressStopRatio]] forKey: @"ProgressStopRatio"];
    555     }
    556555   
    557556    if (![fDefaults boolForKey: @"SmallView"])
  • branches/file_selection/macosx/TorrentCell.h

    r1930 r2087  
    3232{
    3333    NSImage * fErrorImage;
    34     CTGradient * fWhiteGradient, * fGrayGradient, * fLightGreenGradient,
     34    CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fLightGreenGradient,
    3535                * fGreenGradient, * fBlueGradient, * fTransparentGradient;
    3636    NSUserDefaults * fDefaults;
  • branches/file_selection/macosx/TorrentCell.m

    r2081 r2087  
    4949        fWhiteGradient = [[CTGradient progressWhiteGradient] retain];
    5050        fGrayGradient = [[CTGradient progressGrayGradient] retain];
     51        fLightGrayGradient = [[CTGradient unifiedNormalGradient] retain];
    5152        fBlueGradient = [[CTGradient progressBlueGradient] retain];
    5253        fGreenGradient = [[CTGradient progressGreenGradient] retain];
     
    8586    completeBounds.size.width = progress * width;
    8687   
     88    if (progress < 1.0)
     89    {
     90        [fWhiteGradient fillRect: barBounds angle: -90];
     91       
     92        float left = [[info objectForKey: @"Left"] floatValue];
     93        if ((progress + left) < 1.0)
     94        {
     95            NSRect blankBounds = barBounds;
     96            blankBounds.origin.x += width * (progress + left);
     97            blankBounds.size.width = width * ((1.0 - progress) - left);
     98           
     99            [fLightGrayGradient fillRect: blankBounds angle: -90];
     100        }
     101    }
     102   
    87103    if ([[info objectForKey: @"Seeding"] boolValue])
    88104    {
     
    90106        ratioBounds.size.width *= [[info objectForKey: @"ProgressStopRatio"] floatValue];
    91107       
    92         if (completeBounds.size.width < barBounds.size.width)
    93             [fWhiteGradient fillRect: barBounds angle: -90];
    94108        if (ratioBounds.size.width < completeBounds.size.width)
    95109            [fLightGreenGradient fillRect: completeBounds angle: -90];
     
    98112    else
    99113    {
    100         if (completeBounds.size.width < barBounds.size.width)
    101             [fWhiteGradient fillRect: barBounds angle: -90];
    102        
    103114        if ([[info objectForKey: @"Active"] boolValue])
    104115            [fBlueGradient fillRect: completeBounds angle: -90];
     
    106117            [fGrayGradient fillRect: completeBounds angle: -90];
    107118    }
     119   
     120   
     121   
    108122    [[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] set];
    109123    [NSBezierPath strokeRect: NSInsetRect(barBounds, 0.5, 0.5)];
Note: See TracChangeset for help on using the changeset viewer.