Changeset 6081
- Timestamp:
- Jun 8, 2008, 4:11:29 AM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/InfoWindowController.h
r6079 r6081 66 66 IBOutlet NSSegmentedControl * fPiecesControl; 67 67 float fWebSeedTableHeight, fSpaceBetweenWebSeedAndPeer; 68 NSViewAnimation * fWebSeedTableAnimation; 68 69 69 70 IBOutlet FileOutlineController * fFileController; -
trunk/macosx/InfoWindowController.m
r6080 r6081 636 636 } 637 637 638 - (NSSize) windowWillResize: (NSWindow *) window toSize: (NSSize) proposedFrameSize 639 { 640 [fWebSeedTableAnimation stopAnimation]; 641 return proposedFrameSize; 642 } 643 644 - (void) windowDidResize: (NSNotification *) notification 645 { 646 //this is an edge-case - if it's reached, just safely resize the tables without animation 647 if (fWebSeedTableAnimation) 648 [self setWebSeederTableHidden: !fWebSeeds || [fWebSeeds count] == 0 animate: NO]; 649 } 650 638 651 - (void) setTab: (id) sender 639 652 { … … 1442 1455 - (void) setWebSeederTableHidden: (BOOL) hide animate: (BOOL) animate 1443 1456 { 1444 if ( /*![NSApp isOnLeopardOrBetter]*/YES)1457 if (![[self window] isVisible]) 1445 1458 animate = NO; 1459 1460 if (fWebSeedTableAnimation) 1461 { 1462 [fWebSeedTableAnimation stopAnimation]; 1463 [fWebSeedTableAnimation release]; 1464 fWebSeedTableAnimation = nil; 1465 } 1446 1466 1447 1467 NSRect webSeedFrame = [[fWebSeedTable enclosingScrollView] frame]; … … 1464 1484 } 1465 1485 1486 [[fWebSeedTable enclosingScrollView] setHidden: NO]; //this is needed for some reason 1487 1466 1488 //actually resize tables 1467 1489 if (animate) 1468 1490 { 1469 [NSAnimationContext beginGrouping]; 1470 1471 [[NSAnimationContext currentContext] setDuration: 0.2]; 1472 1473 [[[fWebSeedTable enclosingScrollView] animator] setFrame: webSeedFrame]; 1474 [[[fPeerTable enclosingScrollView] animator] setFrame: peerFrame]; 1475 1476 [NSAnimationContext endGrouping]; 1491 NSDictionary * webSeedDict = [NSDictionary dictionaryWithObjectsAndKeys: 1492 [fWebSeedTable enclosingScrollView], NSViewAnimationTargetKey, 1493 [NSValue valueWithRect: [[fWebSeedTable enclosingScrollView] frame]], NSViewAnimationStartFrameKey, 1494 [NSValue valueWithRect: webSeedFrame], NSViewAnimationEndFrameKey, nil], 1495 * peerDict = [NSDictionary dictionaryWithObjectsAndKeys: 1496 [fPeerTable enclosingScrollView], NSViewAnimationTargetKey, 1497 [NSValue valueWithRect: [[fPeerTable enclosingScrollView] frame]], NSViewAnimationStartFrameKey, 1498 [NSValue valueWithRect: peerFrame], NSViewAnimationEndFrameKey, nil]; 1499 1500 fWebSeedTableAnimation = [[NSViewAnimation alloc] initWithViewAnimations: 1501 [NSArray arrayWithObjects: webSeedDict, peerDict, nil]]; 1502 [fWebSeedTableAnimation setDuration: 0.2]; 1503 [fWebSeedTableAnimation setAnimationBlockingMode: NSAnimationNonblockingThreaded]; 1504 [fWebSeedTableAnimation setDelegate: self]; 1505 1506 [fWebSeedTableAnimation startAnimation]; 1477 1507 } 1478 1508 else … … 1480 1510 [[fWebSeedTable enclosingScrollView] setFrame: webSeedFrame]; 1481 1511 [[fPeerTable enclosingScrollView] setFrame: peerFrame]; 1512 } 1513 } 1514 1515 - (void) animationDidEnd: (NSAnimation *) animation 1516 { 1517 if (animation == fWebSeedTableAnimation) 1518 { 1519 [fWebSeedTableAnimation release]; 1520 fWebSeedTableAnimation = nil; 1482 1521 } 1483 1522 }
Note: See TracChangeset
for help on using the changeset viewer.