Display of selected filters now works correctly

This commit is contained in:
Michael Starke
2018-08-23 22:37:38 +02:00
parent eb8c5c4749
commit d902aa893c
2 changed files with 25 additions and 12 deletions

View File

@@ -96,15 +96,15 @@ NSString *const kMPDocumentSearchResultsKey = @"kMPDocumentSearchResul
NSAssert([sender isKindOfClass:NSMenuItem.class], @"Internal inconsitency. Did expect NSMenuItem expected, but got %@", [sender class]);
state = ((NSMenuItem *)sender).state;
/* Manually toggle the state since the popupbuttoncell doesn't do it like we want it to */
state = state == NSControlStateValueOn ? NSControlStateValueOff : NSControlStateValueOn;
state = state == NSOnState ? NSOffState : NSOnState;
}
switch(state) {
case NSControlStateValueOff:
case NSOffState:
toggleFlag ^= MPEntrySearchAllCombineableFlags;
newFlags = isSingleFlag ? MPEntrySearchNone : (self.searchContext.searchFlags & toggleFlag);
break;
case NSControlStateValueOn:
case NSOnState:
if(isSingleFlag ) {
newFlags = toggleFlag; // This has to be either expired or double passwords
}