mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-13 06:01:28 +00:00
Fixed: setContentSize doesn't work when called several times
Previously when calling setContentSize several times, the final frame of the view was wrong. I removed the animation as well. This doesn't work, and need a lot more of implementation.
This commit is contained in:
+1
-2
@@ -150,8 +150,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
|
||||
*/
|
||||
- (void)setContentSize:(CGSize)aSize
|
||||
{
|
||||
[[_contentViewController view] setFrameSize:aSize];
|
||||
[_popoverWindow updateFrame];
|
||||
[_popoverWindow updateFrameWithSize:aSize];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -170,7 +170,9 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
if (![_targetView window])
|
||||
return;
|
||||
|
||||
[self updateFrame];
|
||||
var point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
|
||||
[self setFrameOrigin:point];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,17 +369,18 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)updateFrame
|
||||
- (void)updateFrameWithSize:(CGSize)aSize
|
||||
{
|
||||
var rect = CGRectMakeCopy([self frameRectForContentRect:[[self contentView] frame]]),
|
||||
point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
var rect = CGRectMakeZero();
|
||||
rect.size = aSize;
|
||||
rect.origin = [[self contentView] frameOrigin];
|
||||
|
||||
rect.origin = point;
|
||||
[self setFrame:[self frameRectForContentRect:rect]];
|
||||
|
||||
[self setFrame:rect display:YES animate:_animates];
|
||||
var point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
[self setFrameOrigin:point];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Actions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user