Fixed: CPPopover doesn't change his frame when with setContentSize

Previously when we changed the contentSize of an open popover, nothing happens.
Now, we the frame change and it's animated if needed
This commit is contained in:
Alexandre Wilhelm committed 2014-04-30 15:38:13 -07:00
1 parent 07f7ad0a05
commit 4dadf0cb95
2 files changed
+16 -3

No files matched your search

+1
View File
@@ -151,6 +151,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
- (void)setContentSize:(CGSize)aSize
{
[[_contentViewController view] setFrameSize:aSize];
[_popoverWindow updateFrame];
}
/*!
+15 -3
View File
@@ -170,9 +170,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
if (![_targetView window])
return;
var point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
[self setFrameOrigin:point];
[self updateFrame];
}
}
@@ -366,6 +364,20 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
return CPBrowserStyleProperty('transition') && CPBrowserStyleProperty('transitionend');
}
/*!
@ignore
*/
- (void)updateFrame
{
var rect = CGRectMakeCopy([self frameRectForContentRect:[[self contentView] frame]]),
point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
rect.origin = point;
[self setFrame:rect display:YES animate:_animates];
}
#pragma mark -
#pragma mark Actions