Bind enabled and title for touch bar buttons by default

This commit is contained in:
Bi11 committed 2017-01-10 07:34:52 +08:00
1 parent f795802d60
commit 07599c2ffd
2 files changed
+3 -2

No files matched your search

-2
View File
@@ -136,8 +136,6 @@
{
self.touchBarProvider = [[SUTouchBarProvider alloc] initWithIdentifier:self.className];
self.touchBarButton = [self.touchBarProvider addButtonWithButton:self.actionButton];
[self.touchBarButton bind:@"title" toObject:self.actionButton withKeyPath:@"title" options:nil];
[self.touchBarButton bind:@"enabled" toObject:self.actionButton withKeyPath:@"enabled" options:nil];
return self.touchBarProvider.touchBar;
}
+3
View File
@@ -54,6 +54,9 @@
NSButton *buttonCopy = [NSButton buttonWithTitle:button.title target:button.target action:button.action];
buttonCopy.keyEquivalent = button.keyEquivalent;
buttonCopy.tag = button.tag;
[buttonCopy bind:@"title" toObject:button withKeyPath:@"title" options:nil];
[buttonCopy bind:@"enabled" toObject:button withKeyPath:@"enabled" options:nil];
item.view = buttonCopy;
[self.touchBarItems addObject:item];