diff --git a/macosx/CocoaCompatibility.h b/macosx/CocoaCompatibility.h index b7304eeab..f72068d8f 100644 --- a/macosx/CocoaCompatibility.h +++ b/macosx/CocoaCompatibility.h @@ -37,4 +37,17 @@ typedef NS_ENUM(NSInteger, NSTableViewStyle) { #endif +// Compatibility declarations to build `@available(macOS 13.0, *)` code with older Xcode 11.3.1 (the last 32-bit OS compatible Xcode) +#ifndef __MAC_13_0 + +typedef NS_ENUM(NSInteger, NSColorWellStyle) { + NSColorWellStyleMinimal = 1, +} API_AVAILABLE(macos(13.0)); + +@interface NSColorWell () +@property(assign) NSColorWellStyle colorWellStyle API_AVAILABLE(macos(13.0)); +@end + +#endif + NS_ASSUME_NONNULL_END diff --git a/macosx/GroupsPrefsController.mm b/macosx/GroupsPrefsController.mm index 448e62b9d..7452a6eef 100644 --- a/macosx/GroupsPrefsController.mm +++ b/macosx/GroupsPrefsController.mm @@ -2,6 +2,8 @@ // It may be used under the MIT (SPDX: MIT) license. // License text can be found in the licenses/ folder. +#import "CocoaCompatibility.h" + #import "GroupsPrefsController.h" #import "GroupsController.h" #import "ExpandedPathToPathTransformer.h" @@ -41,6 +43,11 @@ typedef NS_ENUM(NSInteger, SegmentTag) { [self.fSelectedColorView addObserver:self forKeyPath:@"color" options:0 context:NULL]; + if (@available(macOS 13.0, *)) + { + self.fSelectedColorView.colorWellStyle = NSColorWellStyleMinimal; + } + [self updateSelectedGroup]; }