transmission/macosx/ButtonToolbarItem.mm

24 lines
609 B
Plaintext
Raw Normal View History

// This file Copyright © 2007-2022 Transmission authors and contributors.
// It may be used under the MIT (SPDX: MIT) license.
// License text can be found in the licenses/ folder.
#import "ButtonToolbarItem.h"
@implementation ButtonToolbarItem
- (void)validate
{
self.enabled = [self.target validateToolbarItem:self];
}
- (NSMenuItem*)menuFormRepresentation
2007-12-04 01:46:27 +00:00
{
NSMenuItem* menuItem = [[NSMenuItem alloc] initWithTitle:self.label action:self.action keyEquivalent:@""];
menuItem.target = self.target;
menuItem.enabled = [self.target validateToolbarItem:self];
2017-07-29 16:14:22 +00:00
return menuItem;
2007-12-04 01:46:27 +00:00
}
@end