mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00: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
Notes:
github-actions[bot]
2025-10-24 16:43:02 +00:00
Author: https://github.com/juniorrantila
Commit: 8c8961171c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6560
Reviewed-by: https://github.com/trflynn89
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue