fix hovered state being removed when the mouse leaves a subview of a control

This commit is contained in:
Klaas Pieter Annema committed 2010-09-17 13:21:54 +02:00
1 parent 7aa7d61984
commit c481d55976
1 file changed
+7 -1
+7 -1
View File
@@ -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];
}
/*!