mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
Fix constraints issues on Yosemite when hiding web seed view (OS X)
This commit is contained in:
parent
375571c9b4
commit
87373cdafd
3 changed files with 35 additions and 23 deletions
|
@ -9,9 +9,8 @@
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="fConnectedPeersField" destination="3" id="31"/>
|
<outlet property="fConnectedPeersField" destination="3" id="31"/>
|
||||||
<outlet property="fPeerTable" destination="9" id="37"/>
|
<outlet property="fPeerTable" destination="9" id="37"/>
|
||||||
<outlet property="fPeerTableTopConstraint" destination="1HX-la-u47" id="zd4-80-4DZ"/>
|
|
||||||
<outlet property="fWebSeedTable" destination="22" id="38"/>
|
<outlet property="fWebSeedTable" destination="22" id="38"/>
|
||||||
<outlet property="fWebSeedTableHeightConstraint" destination="4th-jd-ByN" id="hUk-mR-d0k"/>
|
<outlet property="fWebSeedTableTopConstraint" destination="IMm-aI-A03" id="3qg-eC-YGm"/>
|
||||||
<outlet property="view" destination="2" id="32"/>
|
<outlet property="view" destination="2" id="32"/>
|
||||||
</connections>
|
</connections>
|
||||||
</customObject>
|
</customObject>
|
||||||
|
@ -212,14 +211,16 @@ Multiline Label</string>
|
||||||
</textField>
|
</textField>
|
||||||
</subviews>
|
</subviews>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="5" firstAttribute="top" secondItem="4" secondAttribute="bottom" constant="4" id="1HX-la-u47"/>
|
<constraint firstItem="5" firstAttribute="top" secondItem="4" secondAttribute="bottom" priority="998" constant="4" id="1HX-la-u47"/>
|
||||||
<constraint firstItem="4" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="5f9-U1-5ZR"/>
|
<constraint firstItem="4" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="5f9-U1-5ZR"/>
|
||||||
<constraint firstItem="3" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="7lL-BM-0yj"/>
|
<constraint firstItem="3" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="7lL-BM-0yj"/>
|
||||||
<constraint firstItem="4" firstAttribute="top" secondItem="2" secondAttribute="top" constant="12" id="IMm-aI-A03"/>
|
<constraint firstItem="4" firstAttribute="top" secondItem="2" secondAttribute="top" constant="12" id="IMm-aI-A03"/>
|
||||||
<constraint firstAttribute="trailing" secondItem="3" secondAttribute="trailing" constant="12" id="PfO-Qp-6s2"/>
|
<constraint firstAttribute="trailing" secondItem="3" secondAttribute="trailing" constant="12" id="PfO-Qp-6s2"/>
|
||||||
<constraint firstAttribute="bottom" secondItem="3" secondAttribute="bottom" constant="12" id="R8j-Z7-6VA"/>
|
<constraint firstAttribute="bottom" secondItem="3" secondAttribute="bottom" constant="12" id="R8j-Z7-6VA"/>
|
||||||
<constraint firstItem="3" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="4" id="ksH-yX-eMF"/>
|
<constraint firstItem="3" firstAttribute="top" secondItem="5" secondAttribute="bottom" priority="998" constant="4" id="ksH-yX-eMF"/>
|
||||||
<constraint firstItem="5" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="lcP-Pq-CY0"/>
|
<constraint firstItem="5" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="12" id="lcP-Pq-CY0"/>
|
||||||
|
<constraint firstItem="5" firstAttribute="top" relation="greaterThanOrEqual" secondItem="4" secondAttribute="bottom" constant="4" id="pIJ-b4-EP1"/>
|
||||||
|
<constraint firstItem="5" firstAttribute="top" secondItem="2" secondAttribute="top" priority="999" constant="12" id="t9u-iC-TTZ"/>
|
||||||
<constraint firstAttribute="trailing" secondItem="5" secondAttribute="trailing" constant="12" id="tCQ-be-4sj"/>
|
<constraint firstAttribute="trailing" secondItem="5" secondAttribute="trailing" constant="12" id="tCQ-be-4sj"/>
|
||||||
<constraint firstAttribute="trailing" secondItem="4" secondAttribute="trailing" constant="12" id="zRK-YF-yfr"/>
|
<constraint firstAttribute="trailing" secondItem="4" secondAttribute="trailing" constant="12" id="zRK-YF-yfr"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
|
|
|
@ -37,12 +37,11 @@
|
||||||
|
|
||||||
IBOutlet NSTableView * fPeerTable;
|
IBOutlet NSTableView * fPeerTable;
|
||||||
IBOutlet WebSeedTableView * fWebSeedTable;
|
IBOutlet WebSeedTableView * fWebSeedTable;
|
||||||
CGFloat fWebSeedTableHeight, fSpaceBetweenWebSeedAndPeer;
|
|
||||||
|
|
||||||
IBOutlet NSTextField * fConnectedPeersField;
|
IBOutlet NSTextField * fConnectedPeersField;
|
||||||
|
|
||||||
IBOutlet NSLayoutConstraint * fWebSeedTableHeightConstraint;
|
CGFloat fViewTopMargin;
|
||||||
IBOutlet NSLayoutConstraint * fPeerTableTopConstraint;
|
IBOutlet NSLayoutConstraint * fWebSeedTableTopConstraint;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setInfoForTorrents: (NSArray *) torrents;
|
- (void) setInfoForTorrents: (NSArray *) torrents;
|
||||||
|
|
|
@ -32,6 +32,9 @@
|
||||||
#import "transmission.h" // required by utils.h
|
#import "transmission.h" // required by utils.h
|
||||||
#import "utils.h"
|
#import "utils.h"
|
||||||
|
|
||||||
|
#define ANIMATION_ID_KEY @"animationId"
|
||||||
|
#define WEB_SEED_ANIMATION_ID @"webSeed"
|
||||||
|
|
||||||
@interface InfoPeersViewController (Private)
|
@interface InfoPeersViewController (Private)
|
||||||
|
|
||||||
- (void) setupInfo;
|
- (void) setupInfo;
|
||||||
|
@ -92,17 +95,14 @@
|
||||||
"inspector -> web seed table -> header tool tip")];
|
"inspector -> web seed table -> header tool tip")];
|
||||||
|
|
||||||
//prepare for animating peer table and web seed table
|
//prepare for animating peer table and web seed table
|
||||||
NSRect webSeedTableFrame = [[fWebSeedTable enclosingScrollView] frame];
|
fViewTopMargin = fWebSeedTableTopConstraint.constant;
|
||||||
fWebSeedTableHeight = webSeedTableFrame.size.height;
|
|
||||||
fSpaceBetweenWebSeedAndPeer = webSeedTableFrame.origin.y - NSMaxY([[fPeerTable enclosingScrollView] frame]);
|
|
||||||
|
|
||||||
CABasicAnimation * webSeedTableAnimation = [CABasicAnimation animation];
|
CABasicAnimation * webSeedTableAnimation = [CABasicAnimation animation];
|
||||||
webSeedTableAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear];
|
[webSeedTableAnimation setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]];
|
||||||
webSeedTableAnimation.duration = 0.125;
|
[webSeedTableAnimation setDuration: 0.125];
|
||||||
[fWebSeedTableHeightConstraint setAnimations: [NSDictionary dictionaryWithObject: webSeedTableAnimation
|
[webSeedTableAnimation setDelegate: self];
|
||||||
forKey: @"constant"]];
|
[webSeedTableAnimation setValue: WEB_SEED_ANIMATION_ID forKey: ANIMATION_ID_KEY];
|
||||||
[fPeerTableTopConstraint setAnimations: [NSDictionary dictionaryWithObject: webSeedTableAnimation
|
[fWebSeedTableTopConstraint setAnimations: @{ @"constant": webSeedTableAnimation }];
|
||||||
forKey: @"constant"]];
|
|
||||||
|
|
||||||
[self setWebSeedTableHidden: YES animate: NO];
|
[self setWebSeedTableHidden: YES animate: NO];
|
||||||
}
|
}
|
||||||
|
@ -450,6 +450,22 @@
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) animationDidStart: (CAAnimation *) animation
|
||||||
|
{
|
||||||
|
if (![[animation valueForKey: ANIMATION_ID_KEY] isEqualToString: WEB_SEED_ANIMATION_ID])
|
||||||
|
return;
|
||||||
|
|
||||||
|
[[fWebSeedTable enclosingScrollView] setHidden: NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) animationDidStop: (CAAnimation *) animation finished: (BOOL) finished
|
||||||
|
{
|
||||||
|
if (![[animation valueForKey: ANIMATION_ID_KEY] isEqualToString: WEB_SEED_ANIMATION_ID])
|
||||||
|
return;
|
||||||
|
|
||||||
|
[[fWebSeedTable enclosingScrollView] setHidden: finished && fWebSeedTableTopConstraint.constant < 0];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation InfoPeersViewController (Private)
|
@implementation InfoPeersViewController (Private)
|
||||||
|
@ -495,13 +511,9 @@
|
||||||
if (animate && (![[self view] window] || ![[[self view] window] isVisible]))
|
if (animate && (![[self view] window] || ![[[self view] window] isVisible]))
|
||||||
animate = NO;
|
animate = NO;
|
||||||
|
|
||||||
const CGFloat webSeedTableHeight = hide ? 1 : fWebSeedTableHeight;
|
const CGFloat webSeedTableTopMargin = hide ? -NSHeight([[fWebSeedTable enclosingScrollView] frame]) : fViewTopMargin;
|
||||||
const CGFloat spaceBetweenWebSeedAndPeer = hide ? -2 : fSpaceBetweenWebSeedAndPeer;
|
|
||||||
|
|
||||||
[(animate ? [fWebSeedTableHeightConstraint animator] : fWebSeedTableHeightConstraint) setConstant: webSeedTableHeight];
|
[(animate ? [fWebSeedTableTopConstraint animator] : fWebSeedTableTopConstraint) setConstant: webSeedTableTopMargin];
|
||||||
[(animate ? [fPeerTableTopConstraint animator] : fPeerTableTopConstraint) setConstant: spaceBetweenWebSeedAndPeer];
|
|
||||||
|
|
||||||
[[fWebSeedTable enclosingScrollView] setHidden: hide];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *) peerSortDescriptors
|
- (NSArray *) peerSortDescriptors
|
||||||
|
|
Loading…
Add table
Reference in a new issue