for seeding peers overlay a check mark on progress bar

This commit is contained in:
Mitchell Livingston
2007-09-25 21:11:54 +00:00
parent 7a15abaf7a
commit 8d4d653044
5 changed files with 21 additions and 2 deletions
+15
View File
@@ -39,7 +39,22 @@
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
{
if (!fIsHidden)
{
[super drawWithFrame: cellFrame inView: controlView];
if ([self floatValue] >= 1.0)
{
if (!fCheckImage)
{
fCheckImage = [NSImage imageNamed: @"CompleteCheck.png"];
[fCheckImage setFlipped: YES];
}
NSSize imageSize = [fCheckImage size];
NSRect rect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - imageSize.width) * 0.5,
cellFrame.origin.y + (cellFrame.size.height - imageSize.height) * 0.5, imageSize.width, imageSize.height);
[fCheckImage drawInRect: rect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
}
}
}
@end