diff --git a/macosx/CTGradient/CTGradientAdditions.h b/macosx/CTGradient/CTGradientAdditions.h index 0e79816a4..b60170e05 100644 --- a/macosx/CTGradient/CTGradientAdditions.h +++ b/macosx/CTGradient/CTGradientAdditions.h @@ -34,8 +34,10 @@ + (CTGradient *)progressGrayGradient; + (CTGradient *)progressLightGrayGradient; + (CTGradient *)progressBlueGradient; ++ (CTGradient *)progressDarkBlueGradient; + (CTGradient *)progressGreenGradient; + (CTGradient *)progressLightGreenGradient; ++ (CTGradient *)progressDarkGreenGradient; + (CTGradient *)progressYellowGradient; + (CTGradient *)progressTransparentGradient; @end diff --git a/macosx/CTGradient/CTGradientAdditions.m b/macosx/CTGradient/CTGradientAdditions.m index a64836d85..b21465bf9 100644 --- a/macosx/CTGradient/CTGradientAdditions.m +++ b/macosx/CTGradient/CTGradientAdditions.m @@ -230,6 +230,46 @@ return [newInstance autorelease]; } ++ (CTGradient *)progressDarkBlueGradient +{ + CTGradient *newInstance = [[[self class] alloc] init]; + + CTGradientElement color1; + color1.red = 0.616; + color1.green = 0.722; + color1.blue = 0.776; + color1.alpha = 1.00; + color1.position = 0; + + CTGradientElement color2; + color2.red = 0.525; + color2.green = 0.631; + color2.blue = 0.737; + color2.alpha = 1.00; + color2.position = 0.5; + + CTGradientElement color3; + color3.red = 0.651; + color3.green = 0.725; + color3.blue = 0.804; + color3.alpha = 1.00; + color3.position = 0.5; + + CTGradientElement color4; + color4.red = 0.659; + color4.green = 0.733; + color4.blue = 0.800; + color4.alpha = 1.00; + color4.position = 1; + + [newInstance addElement:&color1]; + [newInstance addElement:&color2]; + [newInstance addElement:&color3]; + [newInstance addElement:&color4]; + + return [newInstance autorelease]; +} + + (CTGradient *)progressGreenGradient { CTGradient *newInstance = [[[self class] alloc] init]; @@ -275,30 +315,70 @@ CTGradient *newInstance = [[[self class] alloc] init]; CTGradientElement color1; - color1.red = 0.478; - color1.green = 1.00; - color1.blue = 0.55; + color1.red = 0.522; + color1.green = 0.894; + color1.blue = 0.565; color1.alpha = 1.00; color1.position = 0; CTGradientElement color2; - color2.red = 0.388; - color2.green = 0.92; - color2.blue = 0.44; + color2.red = 0.373; + color2.green = 0.780; + color2.blue = 0.408; color2.alpha = 1.00; color2.position = 0.5; CTGradientElement color3; - color3.red = 0.627; - color3.green = 1.00; - color3.blue = 0.53; + color3.red = 0.659; + color3.green = 0.918; + color3.blue = 0.604; color3.alpha = 1.00; color3.position = 0.5; CTGradientElement color4; - color4.red = 0.675; - color4.green = 1.00; - color4.blue = 0.55; + color4.red = 0.678; + color4.green = 0.929; + color4.blue = 0.608; + color4.alpha = 1.00; + color4.position = 1; + + [newInstance addElement:&color1]; + [newInstance addElement:&color2]; + [newInstance addElement:&color3]; + [newInstance addElement:&color4]; + + return [newInstance autorelease]; +} + ++ (CTGradient *)progressDarkGreenGradient +{ + CTGradient *newInstance = [[[self class] alloc] init]; + + CTGradientElement color1; + color1.red = 0.627; + color1.green = 0.714; + color1.blue = 0.639; + color1.alpha = 1.00; + color1.position = 0; + + CTGradientElement color2; + color2.red = 0.545; + color2.green = 0.635; + color2.blue = 0.561; + color2.alpha = 1.00; + color2.position = 0.5; + + CTGradientElement color3; + color3.red = 0.690; + color3.green = 0.745; + color3.blue = 0.675; + color3.alpha = 1.00; + color3.position = 0.5; + + CTGradientElement color4; + color4.red = 0.694; + color4.green = 0.741; + color4.blue = 0.678; color4.alpha = 1.00; color4.position = 1; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index b9ab1975c..90e8b5e0a 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -525,6 +525,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 [NSNumber numberWithBool: [self isActive]], @"Active", [NSNumber numberWithBool: [self isSeeding]], @"Seeding", [NSNumber numberWithBool: [self isChecking]], @"Checking", + [NSNumber numberWithBool: fWaitToStart], @"Waiting", [NSNumber numberWithBool: [self isError]], @"Error", nil]; if ([self isSeeding]) diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index bd10e4f96..4cb397dbc 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -50,10 +50,10 @@ fGrayGradient = [[CTGradient progressGrayGradient] retain]; fLightGrayGradient = [[CTGradient progressLightGrayGradient] retain]; fBlueGradient = [[CTGradient progressBlueGradient] retain]; - //fDarkBlueGradient = [[CTGradient progressDarkBlueGradient] retain]; + fDarkBlueGradient = [[CTGradient progressDarkBlueGradient] retain]; fGreenGradient = [[CTGradient progressGreenGradient] retain]; fLightGreenGradient = [[CTGradient progressLightGreenGradient] retain]; - //fDarkGreenGradient = [[CTGradient progressDarkGreenGradient] retain]; + fDarkGreenGradient = [[CTGradient progressDarkGreenGradient] retain]; fYellowGradient = [[CTGradient progressYellowGradient] retain]; fTransparentGradient = [[CTGradient progressTransparentGradient] retain]; @@ -88,11 +88,12 @@ float progress = [[info objectForKey: @"Progress"] floatValue]; completeBounds.size.width = progress * width; + float left = INVALID; if (progress < 1.0) { [fWhiteGradient fillRect: barBounds angle: -90]; - float left = [[info objectForKey: @"Left"] floatValue]; + left = [[info objectForKey: @"Left"] floatValue]; if ((progress + left) < 1.0) { NSRect blankBounds = barBounds; @@ -120,7 +121,20 @@ [fBlueGradient fillRect: completeBounds angle: -90]; } else - [fGrayGradient fillRect: completeBounds angle: -90]; + { + if ([[info objectForKey: @"Waiting"] boolValue]) + { + if (left == INVALID) + left = [[info objectForKey: @"Left"] floatValue]; + + if (left <= 0.0) + [fDarkGreenGradient fillRect: completeBounds angle: -90]; + else + [fDarkBlueGradient fillRect: completeBounds angle: -90]; + } + else + [fGrayGradient fillRect: completeBounds angle: -90]; + } [[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] set]; [NSBezierPath strokeRect: NSInsetRect(barBounds, 0.5, 0.5)];