Changeset 9317
- Timestamp:
- Oct 18, 2009, 1:54:13 AM (13 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/NSStringAdditions.m
r9140 r9317 116 116 { 117 117 NSMutableArray * timeArray = [NSMutableArray arrayWithCapacity: MIN(max, 4)]; 118 NSUIntegerremaining = seconds;118 uint64_t remaining = seconds; 119 119 120 120 if (max > 0 && seconds >= (24 * 60 * 60)) -
trunk/macosx/PiecesView.h
r7659 r9317 31 31 int8_t * fPieces; 32 32 33 NSImage * fBack;34 33 NSColor * fGreenAvailabilityColor, * fBluePieceColor; 35 34 -
trunk/macosx/PiecesView.m
r9139 r9317 43 43 - (void) awakeFromNib 44 44 { 45 //back image46 fBack = [[NSImage alloc] initWithSize: [self bounds].size];47 48 [fBack lockFocus];49 NSGradient * gradient = [[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 0.0f alpha: 0.4f]50 endingColor: [NSColor colorWithCalibratedWhite: 0.2f alpha: 0.4f]];51 [gradient drawInRect: [self bounds] angle: 90.0f];52 [gradient release];53 [fBack unlockFocus];54 55 45 //store box colors 56 fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0 f green: 1.0f blue: 0.4f alpha: 1.0f] retain];57 fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 f green: 0.4f blue: 0.8f alpha: 1.0f] retain];58 46 fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0] retain]; 47 fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain]; 48 59 49 //actually draw the box 60 50 [self setTorrent: nil]; … … 64 54 { 65 55 tr_free(fPieces); 66 67 [fBack release];68 56 69 57 [fGreenAvailabilityColor release]; … … 89 77 } 90 78 91 //reset the view to blank 92 NSImage * newBack = [fBack copy]; 93 [self setImage: newBack]; 94 [newBack release]; 79 NSImage * back = [[NSImage alloc] initWithSize: [self bounds].size]; 80 [back lockFocus]; 81 82 NSGradient * gradient = [[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.4] 83 endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]]; 84 [gradient drawInRect: [self bounds] angle: 90.0]; 85 [gradient release]; 86 [back unlockFocus]; 87 88 [self setImage: back]; 89 [back release]; 95 90 96 91 [self setNeedsDisplay];
Note: See TracChangeset
for help on using the changeset viewer.