another attempt to improve the animation reliability of the sliding web seeds table
This commit is contained in:
parent
1c00343a02
commit
2cbf55351d
|
@ -635,17 +635,26 @@ typedef enum
|
||||||
return windowRect;
|
return windowRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSSize) windowWillResize: (NSWindow *) window toSize: (NSSize) proposedFrameSize
|
- (void) animationDidEnd: (NSAnimation *) animation
|
||||||
{
|
{
|
||||||
[fWebSeedTableAnimation stopAnimation];
|
if (animation == fWebSeedTableAnimation)
|
||||||
return proposedFrameSize;
|
{
|
||||||
|
[fWebSeedTableAnimation release];
|
||||||
|
fWebSeedTableAnimation = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) windowDidResize: (NSNotification *) notification
|
- (NSSize) windowWillResize: (NSWindow *) window toSize: (NSSize) proposedFrameSize
|
||||||
{
|
{
|
||||||
//this is an edge-case - if it's reached, just safely resize the tables without animation
|
//this is an edge-case - just stop the animation (stopAnimation jumps to end frame)
|
||||||
if (fWebSeedTableAnimation)
|
if (fWebSeedTableAnimation)
|
||||||
[self setWebSeederTableHidden: !fWebSeeds || [fWebSeeds count] == 0 animate: NO];
|
{
|
||||||
|
[fWebSeedTableAnimation stopAnimation];
|
||||||
|
[fWebSeedTableAnimation release];
|
||||||
|
fWebSeedTableAnimation = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
return proposedFrameSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setTab: (id) sender
|
- (void) setTab: (id) sender
|
||||||
|
@ -671,6 +680,10 @@ typedef enum
|
||||||
oldResizeSaveKey = @"InspectorContentHeightTracker";
|
oldResizeSaveKey = @"InspectorContentHeightTracker";
|
||||||
break;
|
break;
|
||||||
case TAB_PEERS_TAG:
|
case TAB_PEERS_TAG:
|
||||||
|
//if in the middle of animating, just stop and resize immediately
|
||||||
|
if (fWebSeedTableAnimation)
|
||||||
|
[self setWebSeederTableHidden: !fWebSeeds || [fWebSeeds count] == 0 animate: NO];
|
||||||
|
|
||||||
[fPeers release];
|
[fPeers release];
|
||||||
fPeers = nil;
|
fPeers = nil;
|
||||||
|
|
||||||
|
@ -1454,7 +1467,7 @@ typedef enum
|
||||||
|
|
||||||
- (void) setWebSeederTableHidden: (BOOL) hide animate: (BOOL) animate
|
- (void) setWebSeederTableHidden: (BOOL) hide animate: (BOOL) animate
|
||||||
{
|
{
|
||||||
if (![[self window] isVisible])
|
if (fCurrentTabTag != TAB_PEERS_TAG || ![[self window] isVisible])
|
||||||
animate = NO;
|
animate = NO;
|
||||||
|
|
||||||
if (fWebSeedTableAnimation)
|
if (fWebSeedTableAnimation)
|
||||||
|
@ -1499,8 +1512,8 @@ typedef enum
|
||||||
|
|
||||||
fWebSeedTableAnimation = [[NSViewAnimation alloc] initWithViewAnimations:
|
fWebSeedTableAnimation = [[NSViewAnimation alloc] initWithViewAnimations:
|
||||||
[NSArray arrayWithObjects: webSeedDict, peerDict, nil]];
|
[NSArray arrayWithObjects: webSeedDict, peerDict, nil]];
|
||||||
[fWebSeedTableAnimation setDuration: 0.2];
|
[fWebSeedTableAnimation setDuration: 0.1];
|
||||||
[fWebSeedTableAnimation setAnimationBlockingMode: NSAnimationNonblockingThreaded];
|
[fWebSeedTableAnimation setAnimationBlockingMode: NSAnimationNonblocking];
|
||||||
[fWebSeedTableAnimation setDelegate: self];
|
[fWebSeedTableAnimation setDelegate: self];
|
||||||
|
|
||||||
[fWebSeedTableAnimation startAnimation];
|
[fWebSeedTableAnimation startAnimation];
|
||||||
|
@ -1512,15 +1525,6 @@ typedef enum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) animationDidEnd: (NSAnimation *) animation
|
|
||||||
{
|
|
||||||
if (animation == fWebSeedTableAnimation)
|
|
||||||
{
|
|
||||||
[fWebSeedTableAnimation release];
|
|
||||||
fWebSeedTableAnimation = nil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *) peerSortDescriptors
|
- (NSArray *) peerSortDescriptors
|
||||||
{
|
{
|
||||||
NSMutableArray * descriptors = [NSMutableArray arrayWithCapacity: 2];
|
NSMutableArray * descriptors = [NSMutableArray arrayWithCapacity: 2];
|
||||||
|
|
Loading…
Reference in New Issue