From 2c25d1019beeb4a87f33ac831ddb65dad98aac2a Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 29 May 2007 04:53:05 +0000 Subject: [PATCH] avoid resizing the search field if unnecessary --- macosx/Controller.m | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index c17ee0fa4..6416d16b4 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -2977,22 +2977,25 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy - (void) checkSearchFilter: (NSNotification *) notification { //size search filter to not overlap buttons - float pointX = NSMaxX([fPauseFilterButton frame]) + 2.0; + float pointX = NSMaxX([fPauseFilterButton frame]) + 5.0; NSRect oldFrame = [fSearchFilterField frame], frame = NSMakeRect(pointX, oldFrame.origin.y, NSMaxX(oldFrame) - pointX, oldFrame.size.height); - //make sure it is not too long - if (frame.size.width > SEARCH_FILTER_MAX_WIDTH) + BOOL show; + if (show = (frame.size.width >= SEARCH_FILTER_MIN_WIDTH)) { - float different = frame.size.width - SEARCH_FILTER_MAX_WIDTH; - frame.origin.x += different; - frame.size.width -= different; + //make sure it is not too long + if (frame.size.width > SEARCH_FILTER_MAX_WIDTH) + { + float different = frame.size.width - SEARCH_FILTER_MAX_WIDTH; + frame.origin.x += different; + frame.size.width -= different; + } + [fSearchFilterField setFrame: frame]; } - [fSearchFilterField setFrame: frame]; //hide search filter if it overlaps filter buttons - [fSearchFilterField setHidden: frame.size.width < SEARCH_FILTER_MIN_WIDTH]; - + [fSearchFilterField setHidden: !show]; } - (void) linkHomepage: (id) sender