mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-16 21:41:18 +00:00
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:
1 parent
07f7ad0a05
commit
4dadf0cb95
2 files changed
+16
-3
No files matched your search
@@ -151,6 +151,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
|
||||
- (void)setContentSize:(CGSize)aSize
|
||||
{
|
||||
[[_contentViewController view] setFrameSize:aSize];
|
||||
[_popoverWindow updateFrame];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user