mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-27 02:25:36 +00:00
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:
1 parent
73a2823d0b
commit
5979baa874
2 files changed
+13
-5
No files matched your search
+11
-3
@@ -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
|
||||
{
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user