mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
UI/AppKit: Make project buildable on macOS < 15
When trying to build Ladybird on macOS 14.3, it fails with the error: ``` No visible @interface for 'NSToolbar' declares the selector 'setAllowsDisplayModeCustomization:' (clang arc_may_not_respond) ``` This is caused by macOS < 15 not having the @interface definition for in NSToolbar for setAllowsUserCustomization:(BOOL). By dynamically calling the method, we can avoid the error altogether.
This commit is contained in:
parent
6c71960425
commit
8c8961171c
|
|
@ -94,7 +94,9 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde
|
|||
[self.toolbar setDelegate:self];
|
||||
[self.toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
|
||||
if (@available(macOS 15, *)) {
|
||||
[self.toolbar setAllowsDisplayModeCustomization:NO];
|
||||
if ([self.toolbar respondsToSelector:@selector(setAllowsDisplayModeCustomization:)]) {
|
||||
[self.toolbar performSelector:@selector(setAllowsDisplayModeCustomization:) withObject:nil];
|
||||
}
|
||||
}
|
||||
[self.toolbar setAllowsUserCustomization:NO];
|
||||
[self.toolbar setSizeMode:NSToolbarSizeModeRegular];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user