зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug 279664: fix controlTextDidChange notifications from the SearchTextField. Thanks to olivier@umich.edu for the fix.
This commit is contained in:
Родитель
76cd64b942
Коммит
5ad98e7ac0
|
@ -1456,12 +1456,7 @@ static const int kDisabledQuicksearchPopupItemTag = 9999;
|
|||
// called when the user typed into the quicksearch field, or edits an item inline
|
||||
- (void)controlTextDidChange:(NSNotification *)aNotification
|
||||
{
|
||||
// how can I tell if this is coming from the quicksearch field?
|
||||
// the object seems to be the field editor in that situation
|
||||
|
||||
// currently, ignore all notifications coming from table views (including
|
||||
// outline views), to avoid responding because of inline editing.
|
||||
if (![[aNotification object] isKindOfClass:[NSTableView class]])
|
||||
if ([aNotification object] == mSearchField)
|
||||
{
|
||||
NSString* currentText = [mSearchField stringValue];
|
||||
[self searchStringChanged:currentText];
|
||||
|
|
|
@ -63,8 +63,9 @@
|
|||
if (NSMouseInRect(pointInField, [[self cell] cancelButtonRectFromRect:cellFrame], NO))
|
||||
{
|
||||
[[self cell] cancelButtonClickedWithFrame:cellFrame inView:self];
|
||||
// fake the notification
|
||||
[self textDidChange:[NSNotification notificationWithName:NSControlTextDidChangeNotification object:self]];
|
||||
// fake the notification as close as we can
|
||||
[self textDidChange: [NSNotification notificationWithName: NSTextDidChangeNotification
|
||||
object: [self currentEditor]]];
|
||||
}
|
||||
else if (NSMouseInRect(pointInField, [[self cell] popUpButtonRectFromRect:cellFrame], NO))
|
||||
{
|
||||
|
@ -146,9 +147,7 @@
|
|||
- (void)textDidChange:(NSNotification *)aNotification
|
||||
{
|
||||
[[self cell] searchSubmittedFromView:self];
|
||||
|
||||
if ([[self delegate] respondsToSelector:@selector(controlTextDidChange:)])
|
||||
[[self delegate] controlTextDidChange:aNotification];
|
||||
[super textDidChange: aNotification];
|
||||
}
|
||||
|
||||
- (NSString *)titleOfSelectedPopUpItem
|
||||
|
|
Загрузка…
Ссылка в новой задаче