1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

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

* feat: Use updated minimal NSColorWell style for Groups.

Only on macOS Ventura (13.0+), as AppKit changes were introduced here.

Somewhat fixes #5011

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
This commit is contained in:
Dzmitry Neviadomski 2023-02-27 04:11:36 +03:00 committed by GitHub
parent dcc1d14fc1
commit 4430f72a72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -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

View file

@ -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];
}