You've already forked hotpocket
BTHLABS-58: Share Extension in Apple Apps
This commit is contained in:
42
services/apple/macOS (App)/WindowContentView.m
Normal file
42
services/apple/macOS (App)/WindowContentView.m
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// WindowContentView.m
|
||||
// HotPocket (macOS)
|
||||
//
|
||||
// Created by Tomek Wójcik on 30/09/2025.
|
||||
//
|
||||
|
||||
#import "WindowContentView.h"
|
||||
|
||||
@implementation WindowContentView
|
||||
|
||||
-(void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
self.darkBackgroundColor = [NSColor colorNamed:@"BackgroundColor"];
|
||||
self.lightBackgroundColor = [NSColor windowBackgroundColor];
|
||||
}
|
||||
|
||||
-(BOOL)isOpaque {
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void)drawRect:(NSRect)dirtyRect {
|
||||
[super drawRect:dirtyRect];
|
||||
|
||||
NSAppearance *appearance = self.effectiveAppearance;
|
||||
NSAppearanceName bestMatch = [appearance bestMatchFromAppearancesWithNames:@[
|
||||
NSAppearanceNameAqua,
|
||||
NSAppearanceNameDarkAqua
|
||||
]];
|
||||
|
||||
NSColor *backgroundColor = self.lightBackgroundColor;
|
||||
if ([bestMatch isEqualToString:NSAppearanceNameDarkAqua] == YES) {
|
||||
backgroundColor = self.darkBackgroundColor;
|
||||
}
|
||||
|
||||
if (backgroundColor) {
|
||||
[backgroundColor setFill];
|
||||
NSRectFill(dirtyRect);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user