mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-20 21:49:22 +00:00
fix delegate methods not sent in transient mode when closing
This commit is contained in:
1 parent
7e6ed01dd2
commit
4841f209b3
2 files changed
+20
-3
No files matched your search
@@ -221,6 +221,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
|
||||
|
||||
[_attachedWindow setAppearance:_appearance];
|
||||
[_attachedWindow setAnimates:_animates];
|
||||
[_attachedWindow setDelegate:self];
|
||||
[_attachedWindow setMovableByWindowBackground:NO];
|
||||
[_attachedWindow setFrame:[_attachedWindow frameRectForContentRect:[[_contentViewController view] frame]]];
|
||||
[_attachedWindow setContentView:[_contentViewController view]];
|
||||
@@ -268,6 +269,20 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
|
||||
[self close];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Delegates
|
||||
|
||||
/*! @ignore */
|
||||
- (BOOL)didAttachedWindowShouldClose:(_CPAttachedWindow)anAttachedWindow
|
||||
{
|
||||
[self close];
|
||||
|
||||
// we return NO, because we want the CPPopover to compute
|
||||
// if the attached can be close in order to send delegate messages
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -410,10 +410,12 @@ CPPopoverAppearanceHUD = 1;
|
||||
{
|
||||
// set a close flag to avoid infinite loop
|
||||
_isClosed = YES;
|
||||
[self close];
|
||||
|
||||
if (_delegate && [_delegate respondsToSelector:@selector(didAttachedWindowClose:)])
|
||||
[_delegate didAttachedWindowClose:self];
|
||||
if (_delegate && [_delegate respondsToSelector:@selector(didAttachedWindowShouldClose:)])
|
||||
if ([_delegate didAttachedWindowShouldClose:self])
|
||||
[self close];
|
||||
else
|
||||
[self close];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user