AppKit: Check availability before using macOS 15 API in TabController

This keeps the code building on older macOS versions.
This commit is contained in:
Dan Berglund 2025-05-27 13:07:28 -06:00 committed by Andrew Kaster
parent bd3135f8d3
commit d9e90d4556
Notes: github-actions[bot] 2025-05-27 19:40:28 +00:00

View file

@ -103,7 +103,9 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde
self.toolbar = [[NSToolbar alloc] initWithIdentifier:TOOLBAR_IDENTIFIER];
[self.toolbar setDelegate:self];
[self.toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
[self.toolbar setAllowsDisplayModeCustomization:NO];
if (@available(macOS 15, *)) {
[self.toolbar setAllowsDisplayModeCustomization:NO];
}
[self.toolbar setAllowsUserCustomization:NO];
[self.toolbar setSizeMode:NSToolbarSizeModeRegular];