Fixed: token field menu refusing clicks in recent versions.

Not clear why this worked before but not now. This fix makes sense regardless.

Without this fix, clicks would not be sent through to the token field menu because its window wasn't the key window.

This fix makes the autocomplete menu declare it does not need to and does not want to become the key window.

Fixes #1807.
This commit is contained in:
Alexander Ljungberg committed 2013-02-26 18:55:22 +00:00
1 parent a6fafcd03b
commit d9354c867b
2 files changed
+15 -3

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ CPDocModalWindowMask = 1 << 6;
- (BOOL)canBecomeKeyWindow
{
return YES;
return YES;
}
@end
+14 -2
View File
@@ -54,7 +54,7 @@ var _CPAutocompleteMenuMaximumHeight = 307;
{
textField = aTextField;
_menuWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0, 0, 100, 100) styleMask:CPBorderlessWindowMask];
_menuWindow = [[_CPAutocompleteWindow alloc] initWithContentRect:CGRectMake(0, 0, 100, 100) styleMask:CPBorderlessWindowMask];
[_menuWindow setLevel:CPPopUpMenuWindowLevel];
[_menuWindow setHasShadow:YES];
@@ -85,7 +85,6 @@ var _CPAutocompleteMenuMaximumHeight = 307;
[tableView setRowHeight:24.0];
[tableView setGridStyleMask:CPTableViewGridNone];
[tableView setBackgroundColor:[CPColor clearColor]];
[tableView setGridColor:[CPColor colorWithRed:242.0 / 255.0 green:243.0 / 255.0 blue:245.0 / 255.0 alpha:1.0]];
[scrollView setDocumentView:tableView];
}
@@ -269,9 +268,22 @@ var _CPAutocompleteMenuMaximumHeight = 307;
@end
@implementation _CPAutocompleteWindow : CPPanel
- (BOOL)becomesKeyOnlyIfNeeded
{
return YES;
}
@end
@implementation _CPNonFirstResponderTableView : CPTableView
- (BOOL)needsPanelToBecomeKey
{
return NO;
}
- (BOOL)acceptsFirstResponder
{
return NO;