Changeset 2171 for trunk/macosx/PiecesView.m
- Timestamp:
- Jun 20, 2007, 10:53:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/PiecesView.m
r2149 r2171 30 30 @implementation PiecesView 31 31 32 - (id) init 33 { 34 if ((self = [super init ]))32 - (id) initWithCoder: (NSCoder *) decoder 33 { 34 if ((self = [super initWithCoder: decoder])) 35 35 { 36 36 fTorrent = nil; … … 44 44 - (void) awakeFromNib 45 45 { 46 #warning NSRectFill 47 48 NSSize size = [fImageView bounds].size; 49 NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [fImageView bounds]]; 46 NSSize size = [self bounds].size; 47 NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [self bounds]]; 50 48 51 49 //back image … … 137 135 [fBluePiece unlockFocus]; 138 136 139 [ fImageViewsetToolTip: [[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"]137 [self setToolTip: [[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"] 140 138 ? NSLocalizedString(@"Piece Availability", "Inspector -> Activity -> detailed pieces view tooltip") 141 139 : NSLocalizedString(@"Piece Progress", "Inspector -> Activity -> detailed pieces view tooltip")]; … … 190 188 fAcross = MAX_ACROSS; 191 189 192 float width = [ fImageViewbounds].size.width;190 float width = [self bounds].size.width; 193 191 fWidth = (width - (fAcross + 1) * BETWEEN) / fAcross; 194 192 fExtraBorder = (width - ((fWidth + BETWEEN) * fAcross + BETWEEN)) / 2; … … 197 195 } 198 196 199 [ fImageViewsetHidden: torrent == nil];197 [self setHidden: torrent == nil]; 200 198 } 201 199 … … 206 204 207 205 if (first) 208 [ fImageViewsetImage: [[fBack copy] autorelease]];209 NSImage * image = [ fImageViewimage];206 [self setImage: [[fBack copy] autorelease]]; 207 NSImage * image = [self image]; 210 208 211 209 int8_t * pieces; … … 370 368 { 371 369 [image unlockFocus]; 372 [ fImageViewsetNeedsDisplay];370 [self setNeedsDisplay]; 373 371 } 374 372 … … 379 377 } 380 378 381 - (void) toggleView 379 - (BOOL) acceptsFirstMouse: (NSEvent *) event 380 { 381 return YES; 382 } 383 384 - (void) mouseDown: (NSEvent *) event 382 385 { 383 386 NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults]; … … 386 389 [defaults setBool: showAvailability forKey: @"PiecesViewShowAvailability"]; 387 390 388 [ fImageViewsetToolTip: showAvailability391 [self setToolTip: showAvailability 389 392 ? NSLocalizedString(@"Piece Availability", "Inspector -> Activity -> detailed pieces view tooltip") 390 393 : NSLocalizedString(@"Piece Progress", "Inspector -> Activity -> detailed pieces view tooltip")]; 391 394 392 395 [self updateView: YES]; 396 397 [super mouseDown: event]; 393 398 } 394 399
Note: See TracChangeset
for help on using the changeset viewer.