FIXED: - (BOOL)popoverShouldClose: was not called in transient and semi-transient mode

Previously, handlers of events that could make the popover to close were not calling CPPopover's performClose:. This patch ensure performClose: is called, and so delegates are consulted if the popover can be closed or not
This commit is contained in:
Antoine Mercadal committed 2014-10-01 14:17:39 -07:00
1 parent 73a2823d0b
commit 5979baa874
2 files changed
+13 -5

No files matched your search

+11 -3
View File
@@ -310,9 +310,8 @@ Set the behavior of the CPPopover. It can be:
if ([_popoverWindow isClosing])
return;
if (_implementedDelegateMethods & CPPopoverDelegate_popover_shouldClose_)
if (![_delegate popoverShouldClose:self])
return;
if (![self _popoverShouldClose])
return;
[self _close];
}
@@ -346,6 +345,15 @@ Set the behavior of the CPPopover. It can be:
[_delegate popoverDidShow:self];
}
/*! @ignore */
- (BOOL)_popoverShouldClose
{
if (_implementedDelegateMethods & CPPopoverDelegate_popover_shouldClose_)
return [_delegate popoverShouldClose:self];
return YES;
}
/*! @ignore */
- (void)_popoverWillClose
{
+2 -2
View File
@@ -720,11 +720,11 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
break;
}
[_delegate close];
[_delegate performClose:self];
break;
case CPPopoverBehaviorTransient:
[_delegate close];
[_delegate performClose:self];
break;
case CPPopoverBehaviorApplicationDefined: