Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use updated minimal NSColorWell style for Groups. #5016

Merged
merged 2 commits into from Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions macosx/CocoaCompatibility.h
Expand Up @@ -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
7 changes: 7 additions & 0 deletions macosx/GroupsPrefsController.mm
Expand Up @@ -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"
Expand Down Expand Up @@ -41,6 +43,11 @@ - (void)awakeFromNib

[self.fSelectedColorView addObserver:self forKeyPath:@"color" options:0 context:NULL];

if (@available(macOS 13.0, *))
{
self.fSelectedColorView.colorWellStyle = NSColorWellStyleMinimal;
}

[self updateSelectedGroup];
}

Expand Down