mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-28 22:47:04 +00:00
Make CPPanel -becomesKeyOnlyIfNeeded and CPView -needsPanelToBecomeKey work.
This commit is contained in:
@@ -569,6 +569,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
return YES;
|
||||
}
|
||||
|
||||
/*!
|
||||
Text fields require panels to become key window, so this returns \c YES.
|
||||
*/
|
||||
- (BOOL)needsPanelToBecomeKey
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)mouseDown:(CPEvent)anEvent
|
||||
{
|
||||
// Don't track! (ever?)
|
||||
@@ -1028,6 +1036,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
var view = [[_CPImageAndTextView alloc] initWithFrame:_CGRectMakeZero()];
|
||||
//[view setImagePosition:CPNoImage];
|
||||
|
||||
[view setHitTests:NO];
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -1284,6 +1284,14 @@ var CPViewFlags = { },
|
||||
return self;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns \c YES if this view requires a panel to become key. Normally only text fields, so this returns \c NO.
|
||||
*/
|
||||
- (BOOL)needsPanelToBecomeKey
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns \c YES if mouse events aren't needed by the receiver and can be sent to the superview. The
|
||||
default implementation returns \c NO if the view is opaque.
|
||||
|
||||
@@ -1321,7 +1321,7 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
var theWindow = [anEvent window];
|
||||
|
||||
if ([theWindow isKeyWindow] || [theWindow becomesKeyOnlyIfNeeded])
|
||||
if ([theWindow isKeyWindow] || [theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey])
|
||||
return [_leftMouseDownView mouseDown:anEvent];
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user