Merge pull request #2112 from Dogild/PopoverContentSize

Fixed: CPPopover doesn't change his frame when changing the contentSize
This commit is contained in:
Antoine Mercadal committed 2014-04-30 17:36:29 -07:00
commit 86d186e279
2 files changed
+19 -1

No files matched your search

+4 -1
View File
@@ -150,7 +150,10 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
*/
- (void)setContentSize:(CGSize)aSize
{
[[_contentViewController view] setFrameSize:aSize];
if (!_popoverWindow)
[[_contentViewController view] setFrameSize:aSize];
else
[_popoverWindow updateFrameWithSize:aSize];
}
/*!
+15
View File
@@ -366,6 +366,21 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
return CPBrowserStyleProperty('transition') && CPBrowserStyleProperty('transitionend');
}
/*!
@ignore
*/
- (void)updateFrameWithSize:(CGSize)aSize
{
var rect = CGRectMakeZero();
rect.size = aSize;
rect.origin = [[self contentView] frameOrigin];
[self setFrame:[self frameRectForContentRect:rect]];
var point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
[self setFrameOrigin:point];
}
#pragma mark -
#pragma mark Actions