BTHLABS-58: Share Extension in Apple Apps

This commit is contained in:
2025-10-04 08:02:13 +02:00
parent 0c12f52569
commit 99e9226338
122 changed files with 5488 additions and 411 deletions

View 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