mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 04:52:29 +00:00
Fixed regression resulting in no recent searches being stored.
This was introduced by adding better search filed keyboard navigation in 92c83e0
This commit is contained in:
@@ -175,6 +175,7 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE";
|
|||||||
item.maxSize = NSMakeSize(240, 32);
|
item.maxSize = NSMakeSize(240, 32);
|
||||||
NSMenu *templateMenu = [self _allocateSearchMenuTemplate];
|
NSMenu *templateMenu = [self _allocateSearchMenuTemplate];
|
||||||
searchField.searchMenuTemplate = templateMenu;
|
searchField.searchMenuTemplate = templateMenu;
|
||||||
|
/* 10.10 does not support NSSearchFieldDelegate */
|
||||||
((NSTextField *)searchField).delegate = self;
|
((NSTextField *)searchField).delegate = self;
|
||||||
self.searchField = searchField;
|
self.searchField = searchField;
|
||||||
}
|
}
|
||||||
@@ -232,7 +233,10 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE";
|
|||||||
#pragma mark - NSSearchFieldDelegate
|
#pragma mark - NSSearchFieldDelegate
|
||||||
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
|
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
|
||||||
if(commandSelector == @selector(insertNewline:) || commandSelector == @selector(moveDown:)) {
|
if(commandSelector == @selector(insertNewline:) || commandSelector == @selector(moveDown:)) {
|
||||||
|
/* Dispatch the focus loss since doing it now will break recent search storage */
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self];
|
[[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user