mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-22 05:02:31 +00:00
Simplify if condition
This commit is contained in:
parent
362c4147e4
commit
ac0c10c170
1 changed files with 1 additions and 10 deletions
|
|
@ -1598,16 +1598,7 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) {
|
|||
- (BOOL)validateMenuItem:(NSMenuItem *)item {
|
||||
if (item.action == @selector(performMiniaturize:)) return YES;
|
||||
if (item.action == @selector(toggleSecureInput:)) {
|
||||
SecureKeyboardEntryController *controller = [SecureKeyboardEntryController sharedInstance];
|
||||
if (controller.isEnabled) {
|
||||
if (controller.isDesired) {
|
||||
item.state = NSControlStateValueOn;
|
||||
} else {
|
||||
item.state = NSControlStateValueMixed;
|
||||
}
|
||||
} else {
|
||||
item.state = controller.isDesired ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
}
|
||||
item.state = [SecureKeyboardEntryController sharedInstance].isDesired ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
return YES;
|
||||
}
|
||||
return [super validateMenuItem:item];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue