mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-19 04:59:22 +00:00
Fixed: wrong option for the observer in _CPPopoverWindow
Previously the option of the observer in _CPPopoverWindow were set to 0, now it's set to CPKeyValueObservingOptionNew. This PR fix also another issue, the popoverWindow registered the observer in the wrong order. It firstly observed the frame of the sender and then removed it directly. Now it register when ordering front the popover and remove it when closing the popover
This commit is contained in:
1 parent
b2557c38dd
commit
8b29369b7e
1 file changed
+3
-3
@@ -180,7 +180,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
return;
|
||||
|
||||
_isObservingFrame = YES;
|
||||
[_targetView addObserver:self forKeyPath:@"frame" options:0 context:nil];
|
||||
[_targetView addObserver:self forKeyPath:@"frame" options:CPKeyValueObservingOptionNew context:nil];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -207,7 +207,6 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
return;
|
||||
|
||||
var point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
|
||||
[self setFrameOrigin:point];
|
||||
}
|
||||
}
|
||||
@@ -362,7 +361,6 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
[self setFrameOrigin:point];
|
||||
[_windowView showCursor];
|
||||
[_windowView setNeedsDisplay:YES];
|
||||
[self makeKeyAndOrderFront:nil];
|
||||
|
||||
if (positioningView !== _targetView)
|
||||
{
|
||||
@@ -371,6 +369,8 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
_targetView = positioningView;
|
||||
}
|
||||
|
||||
[self makeKeyAndOrderFront:nil];
|
||||
|
||||
/*
|
||||
If _targetView's window is not a full platform window,
|
||||
add us as a child, because when we close we are detached from
|
||||
|
||||
Reference in new issue
Block a user