mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 22:42:18 +00:00
Fixes #2 MPToolbarItem now validates more sanely
This commit is contained in:
@@ -14,9 +14,12 @@
|
||||
- (void)validate {
|
||||
if(![self.view menu]) {
|
||||
id target = [NSApp targetForAction:[self action] to:nil from:self];
|
||||
BOOL isValid = [[[[NSApplication sharedApplication] keyWindow] windowController] validateToolbarItem:self];
|
||||
[self setEnabled:( isValid && (nil != target) )];
|
||||
|
||||
id windowController = [[self.view window] windowController];
|
||||
BOOL isValid = (nil != target);
|
||||
if( [windowController respondsToSelector:@selector(validateToolbarItem:)]) {
|
||||
isValid &= [windowController validateToolbarItem:self];
|
||||
}
|
||||
[self setEnabled:isValid];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user