Changeset 14706
- Timestamp:
- Mar 3, 2016, 10:27:45 PM (7 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/InfoPeersView.xib
r14685 r14706 10 10 <outlet property="fConnectedPeersField" destination="3" id="31"/> 11 11 <outlet property="fPeerTable" destination="9" id="37"/> 12 <outlet property="fPeerTableTopConstraint" destination="1HX-la-u47" id="zd4-80-4DZ"/>13 12 <outlet property="fWebSeedTable" destination="22" id="38"/> 14 <outlet property="fWebSeedTable HeightConstraint" destination="4th-jd-ByN" id="hUk-mR-d0k"/>13 <outlet property="fWebSeedTableTopConstraint" destination="IMm-aI-A03" id="3qg-eC-YGm"/> 15 14 <outlet property="view" destination="2" id="32"/> 16 15 </connections> … … 213 212 </subviews> 214 213 <constraints> 215 <constraint firstItem="5" firstAttribute="top" secondItem="4" secondAttribute="bottom" constant="4" id="1HX-la-u47"/>214 <constraint firstItem="5" firstAttribute="top" secondItem="4" secondAttribute="bottom" priority="998" constant="4" id="1HX-la-u47"/> 216 215 <constraint firstItem="4" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="5f9-U1-5ZR"/> 217 216 <constraint firstItem="3" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="7lL-BM-0yj"/> … … 219 218 <constraint firstAttribute="trailing" secondItem="3" secondAttribute="trailing" constant="12" id="PfO-Qp-6s2"/> 220 219 <constraint firstAttribute="bottom" secondItem="3" secondAttribute="bottom" constant="12" id="R8j-Z7-6VA"/> 221 <constraint firstItem="3" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="4" id="ksH-yX-eMF"/>220 <constraint firstItem="3" firstAttribute="top" secondItem="5" secondAttribute="bottom" priority="998" constant="4" id="ksH-yX-eMF"/> 222 221 <constraint firstItem="5" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="lcP-Pq-CY0"/> 222 <constraint firstItem="5" firstAttribute="top" relation="greaterThanOrEqual" secondItem="4" secondAttribute="bottom" constant="4" id="pIJ-b4-EP1"/> 223 <constraint firstItem="5" firstAttribute="top" secondItem="2" secondAttribute="top" priority="999" constant="12" id="t9u-iC-TTZ"/> 223 224 <constraint firstAttribute="trailing" secondItem="5" secondAttribute="trailing" constant="12" id="tCQ-be-4sj"/> 224 225 <constraint firstAttribute="trailing" secondItem="4" secondAttribute="trailing" constant="12" id="zRK-YF-yfr"/> -
trunk/macosx/InfoPeersViewController.h
r14685 r14706 38 38 IBOutlet NSTableView * fPeerTable; 39 39 IBOutlet WebSeedTableView * fWebSeedTable; 40 CGFloat fWebSeedTableHeight, fSpaceBetweenWebSeedAndPeer;41 40 42 41 IBOutlet NSTextField * fConnectedPeersField; 43 42 44 IBOutlet NSLayoutConstraint * fWebSeedTableHeightConstraint;45 IBOutlet NSLayoutConstraint * f PeerTableTopConstraint;43 CGFloat fViewTopMargin; 44 IBOutlet NSLayoutConstraint * fWebSeedTableTopConstraint; 46 45 } 47 46 -
trunk/macosx/InfoPeersViewController.m
r14685 r14706 33 33 #import "utils.h" 34 34 35 #define ANIMATION_ID_KEY @"animationId" 36 #define WEB_SEED_ANIMATION_ID @"webSeed" 37 35 38 @interface InfoPeersViewController (Private) 36 39 … … 93 96 94 97 //prepare for animating peer table and web seed table 95 NSRect webSeedTableFrame = [[fWebSeedTable enclosingScrollView] frame]; 96 fWebSeedTableHeight = webSeedTableFrame.size.height; 97 fSpaceBetweenWebSeedAndPeer = webSeedTableFrame.origin.y - NSMaxY([[fPeerTable enclosingScrollView] frame]); 98 fViewTopMargin = fWebSeedTableTopConstraint.constant; 98 99 99 100 CABasicAnimation * webSeedTableAnimation = [CABasicAnimation animation]; 100 webSeedTableAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]; 101 webSeedTableAnimation.duration = 0.125; 102 [fWebSeedTableHeightConstraint setAnimations: [NSDictionary dictionaryWithObject: webSeedTableAnimation 103 forKey: @"constant"]]; 104 [fPeerTableTopConstraint setAnimations: [NSDictionary dictionaryWithObject: webSeedTableAnimation 105 forKey: @"constant"]]; 106 101 [webSeedTableAnimation setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]]; 102 [webSeedTableAnimation setDuration: 0.125]; 103 [webSeedTableAnimation setDelegate: self]; 104 [webSeedTableAnimation setValue: WEB_SEED_ANIMATION_ID forKey: ANIMATION_ID_KEY]; 105 [fWebSeedTableTopConstraint setAnimations: @{ @"constant": webSeedTableAnimation }]; 106 107 107 [self setWebSeedTableHidden: YES animate: NO]; 108 108 } … … 451 451 } 452 452 453 - (void) animationDidStart: (CAAnimation *) animation 454 { 455 if (![[animation valueForKey: ANIMATION_ID_KEY] isEqualToString: WEB_SEED_ANIMATION_ID]) 456 return; 457 458 [[fWebSeedTable enclosingScrollView] setHidden: NO]; 459 } 460 461 - (void) animationDidStop: (CAAnimation *) animation finished: (BOOL) finished 462 { 463 if (![[animation valueForKey: ANIMATION_ID_KEY] isEqualToString: WEB_SEED_ANIMATION_ID]) 464 return; 465 466 [[fWebSeedTable enclosingScrollView] setHidden: finished && fWebSeedTableTopConstraint.constant < 0]; 467 } 468 453 469 @end 454 470 … … 496 512 animate = NO; 497 513 498 const CGFloat webSeedTableHeight = hide ? 1 : fWebSeedTableHeight; 499 const CGFloat spaceBetweenWebSeedAndPeer = hide ? -2 : fSpaceBetweenWebSeedAndPeer; 500 501 [(animate ? [fWebSeedTableHeightConstraint animator] : fWebSeedTableHeightConstraint) setConstant: webSeedTableHeight]; 502 [(animate ? [fPeerTableTopConstraint animator] : fPeerTableTopConstraint) setConstant: spaceBetweenWebSeedAndPeer]; 503 504 [[fWebSeedTable enclosingScrollView] setHidden: hide]; 514 const CGFloat webSeedTableTopMargin = hide ? -NSHeight([[fWebSeedTable enclosingScrollView] frame]) : fViewTopMargin; 515 516 [(animate ? [fWebSeedTableTopConstraint animator] : fWebSeedTableTopConstraint) setConstant: webSeedTableTopMargin]; 505 517 } 506 518
Note: See TracChangeset
for help on using the changeset viewer.