diff --git a/macosx/FilterBar.xib b/macosx/FilterBar.xib index 790edb20e..a8d3aa4df 100644 --- a/macosx/FilterBar.xib +++ b/macosx/FilterBar.xib @@ -15,6 +15,7 @@ + diff --git a/macosx/FilterBarController.mm b/macosx/FilterBarController.mm index 3b374e72a..fa629ff3a 100644 --- a/macosx/FilterBarController.mm +++ b/macosx/FilterBarController.mm @@ -24,7 +24,7 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) { FilterTypeTagTracker = 402, }; -@interface FilterBarController () +@interface FilterBarController () @property(nonatomic) IBOutlet FilterButton* fNoFilterButton; @property(nonatomic) IBOutlet FilterButton* fActiveFilterButton; @@ -34,6 +34,7 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) { @property(nonatomic) IBOutlet FilterButton* fErrorFilterButton; @property(nonatomic) IBOutlet NSSearchField* fSearchField; +@property(nonatomic) IBOutlet NSLayoutConstraint* fSearchFieldMinWidthConstraint; @property(nonatomic) IBOutlet NSPopUpButton* fGroupsButton; @@ -135,8 +136,11 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) { [self updateGroupsButton]; - //update when groups change + // update when groups change [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(updateGroups:) name:@"UpdateGroups" object:nil]; + + // update when filter change + self.fSearchField.delegate = self; } - (void)dealloc @@ -263,6 +267,16 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) { [self.view.window makeFirstResponder:self.fSearchField]; } +- (void)searchFieldDidStartSearching:(NSSearchField*)sender +{ + [self.fSearchFieldMinWidthConstraint animator].constant = 95; +} + +- (void)searchFieldDidEndSearching:(NSSearchField*)sender +{ + [self.fSearchFieldMinWidthConstraint animator].constant = 48; +} + - (void)setSearchType:(id)sender { NSString* oldFilterType = [NSUserDefaults.standardUserDefaults stringForKey:@"FilterSearchType"];