Auto enlarge search field when editing (#4067)
This commit is contained in:
parent
611d36ac84
commit
fa7100bdef
|
@ -15,6 +15,7 @@
|
|||
<outlet property="fNoFilterButton" destination="9" id="27"/>
|
||||
<outlet property="fPauseFilterButton" destination="6" id="28"/>
|
||||
<outlet property="fSearchField" destination="10" id="31"/>
|
||||
<outlet property="fSearchFieldMinWidthConstraint" destination="Ven-bt-DjP" id="X9R-JZ-TVl"/>
|
||||
<outlet property="fSeedFilterButton" destination="7" id="32"/>
|
||||
<outlet property="view" destination="2" id="33"/>
|
||||
</connections>
|
||||
|
|
|
@ -24,7 +24,7 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) {
|
|||
FilterTypeTagTracker = 402,
|
||||
};
|
||||
|
||||
@interface FilterBarController ()
|
||||
@interface FilterBarController ()<NSSearchFieldDelegate>
|
||||
|
||||
@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"];
|
||||
|
|
Loading…
Reference in New Issue