properly show/hide the filter search field

This commit is contained in:
Mitchell Livingston 2007-05-29 03:20:47 +00:00
parent 7012e883bd
commit c23f223f85
3 changed files with 13 additions and 2 deletions

View File

@ -208,6 +208,8 @@
- (void) setWindowSizeToFit;
- (NSRect) sizedWindowFrame;
- (void) checkSearchFilter: (NSNotification *) notification;
- (void) showMainWindow: (id) sender;
- (void) linkHomepage: (id) sender;
- (void) linkForums: (id) sender;

View File

@ -370,8 +370,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[currentFilterButton setEnabled: YES];
[fFilterBar replaceButtons];
//observe notifications
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
@ -413,6 +411,10 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
//change that just impacts the dock badge
[nc addObserver: self selector: @selector(updateDockBadge:)
name: @"DockBadgeChange" object: nil];
//show and hide the search bar in the filter bar
[nc addObserver: self selector: @selector(checkSearchFilter:)
name: @"CheckSearchFilter" object: nil];
//timer to update the interface every second
[self updateUI];
@ -2965,6 +2967,11 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
}
- (void) windowDidResize: (NSNotification *) notification
{
[self checkSearchFilter: nil];
}
- (void) checkSearchFilter: (NSNotification *) notification
{
//hide search filter if it overlaps filter buttons
[fSearchFilterField setHidden: NSMaxX([fPauseFilterButton frame]) + 2.0 > [fSearchFilterField frame].origin.x];

View File

@ -35,6 +35,8 @@
[fPauseFilterButton setFrameOrigin: NSMakePoint(NSMaxX([fSeedFilterButton frame]) + padding, base)];
[self setNeedsDisplay: YES];
[[NSNotificationCenter defaultCenter] postNotificationName: @"CheckSearchFilter" object: nil];
}
@end