From bb9e1a830d22bd241b78495af5c296a10ca0cc6d Mon Sep 17 00:00:00 2001 From: Andreas Date: Tue, 22 Jun 2010 16:06:40 +0200 Subject: [PATCH] Add cancelOperation action to clear text when pressing ESC --- AppKit/CPSearchField.j | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AppKit/CPSearchField.j b/AppKit/CPSearchField.j index 6494df077..e039948e9 100644 --- a/AppKit/CPSearchField.j +++ b/AppKit/CPSearchField.j @@ -182,7 +182,7 @@ var RECENT_SEARCH_PREFIX = @" "; [_cancelButton setFrame:[self cancelButtonRectForBounds:[self bounds]]]; [_cancelButton setAutoresizingMask:CPViewMinXMargin]; [_cancelButton setTarget:self]; - [_cancelButton setAction:@selector(_searchFieldCancel:)]; + [_cancelButton setAction:@selector(cancelOperation:)]; [self _updateCancelButtonVisibility]; [self addSubview:_cancelButton]; } @@ -210,7 +210,7 @@ var RECENT_SEARCH_PREFIX = @" "; [button setAlternateImage:CPSearchFieldCancelPressedImage]; [button setAutoresizingMask:CPViewMinXMargin]; [button setTarget:self]; - [button setAction:@selector(_searchFieldCancel:)]; + [button setAction:@selector(cancelOperation:)]; } // Custom Layout @@ -684,8 +684,8 @@ var RECENT_SEARCH_PREFIX = @" "; [_partialStringTimer invalidate]; } -- (void)_searchFieldCancel:(id)sender -{ +- (void)cancelOperation:(id)sender +{ [self setObjectValue:@""]; [self _sendPartialString]; [self _updateCancelButtonVisibility];