mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-14 02:33:50 +00:00
fix hovered state being removed when the mouse leaves a subview of a control
This commit is contained in:
1 parent
7aa7d61984
commit
c481d55976
1 file changed
+7
-1
+7
-1
@@ -401,7 +401,13 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
|
||||
- (void)mouseExited:(CPEvent)anEvent
|
||||
{
|
||||
[self unsetThemeState:CPThemeStateHovered];
|
||||
var currentLocation = [self convertPoint:[anEvent locationInWindow] fromView:nil],
|
||||
isWithinFrame = [self tracksMouseOutsideOfFrame] || CGRectContainsPoint([self bounds], currentLocation);
|
||||
|
||||
// Make sure we're not still in the frame because Cappuccino will sent mouseExited events
|
||||
// for all of the (ephemeral) subviews of a view as well.
|
||||
if (!isWithinFrame)
|
||||
[self unsetThemeState:CPThemeStateHovered];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in new issue
Block a user