Skip to content

Commit

Permalink
MacGui: use the same toolbar icons in the touch bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
galad87 committed May 12, 2024
1 parent 09758ac commit 3219241
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions macosx/HBController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,16 @@ - (NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar makeItemForIdentifier:(NSTou
NSCustomTouchBarItem *item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
item.customizationLabel = NSLocalizedString(@"Add To Queue", @"Touch bar");

NSButton *button = [NSButton buttonWithTitle:NSLocalizedString(@"Add To Queue", @"Touch bar") target:self action:@selector(addToQueue:)];
NSButton *button = nil;
if (@available (macOS 11, *))
{
NSImage *image = [NSImage imageNamed:@"photo.badge.plus"];
button = [NSButton buttonWithImage:image target:self action:@selector(addToQueue:)];
}
else
{
button = [NSButton buttonWithTitle:NSLocalizedString(@"Add To Queue", @"Touch bar") target:self action:@selector(addToQueue:)];
}

item.view = button;
return item;
Expand Down Expand Up @@ -1834,7 +1843,17 @@ - (NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar makeItemForIdentifier:(NSTou
NSCustomTouchBarItem *item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
item.customizationLabel = NSLocalizedString(@"Show Activity Window", @"Touch bar");

NSButton *button = [NSButton buttonWithImage:[NSImage imageNamed:NSImageNameTouchBarGetInfoTemplate] target:nil action:@selector(showOutputPanel:)];
NSImage *image = nil;
if (@available (macOS 11, *))
{
image = [NSImage imageNamed:@"text.viewfinder"];
}
else
{
image = [NSImage imageNamed:NSImageNameTouchBarPlayTemplate];
}

NSButton *button = [NSButton buttonWithImage:image target:nil action:@selector(showOutputPanel:)];

item.view = button;
return item;
Expand Down

0 comments on commit 3219241

Please sign in to comment.