mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
macOS: Fix text color in visual window select ignoring the color theme
Fixes #8579
This commit is contained in:
parent
598f9b9dac
commit
01415eb84c
2 changed files with 5 additions and 1 deletions
|
|
@ -134,6 +134,8 @@ Detailed list of changes
|
|||
- Single instance: Reset OS Window class and name in new single instance OS
|
||||
windows (:disc:`8567`)
|
||||
|
||||
- macOS: Fix text color in visual window select ignoring the color theme (:iss:`8579`)
|
||||
|
||||
0.41.1 [2025-04-03]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include <CoreText/CoreText.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#define debug debug_fonts
|
||||
static inline void cleanup_cfrelease(void *__p) { CFTypeRef *tp = (CFTypeRef *)__p; CFTypeRef cf = *tp; if (cf) { CFRelease(cf); } }
|
||||
|
|
@ -958,7 +959,8 @@ cocoa_render_line_of_text(const char *text, const color_type fg, const color_typ
|
|||
CGContextSetRGBFillColor(ctx, ((fg >> 16) & 0xff) / 255.f, ((fg >> 8) & 0xff) / 255.f, (fg & 0xff) / 255.f, 1.f);
|
||||
CGContextSetRGBStrokeColor(ctx, ((fg >> 16) & 0xff) / 255.f, ((fg >> 8) & 0xff) / 255.f, (fg & 0xff) / 255.f, 1.f);
|
||||
|
||||
NSAttributedString *str = [[NSAttributedString alloc] initWithString:@(text) attributes:@{(NSString *)kCTFontAttributeName: (__bridge id)window_title_font}];
|
||||
NSColor *color = [NSColor colorWithCalibratedRed:((fg >> 16) & 0xff) / 255.f green:((fg >> 8) & 0xff) / 255.f blue:(fg & 0xff) / 255.f alpha:1.0];
|
||||
NSAttributedString *str = [[NSAttributedString alloc] initWithString:@(text) attributes:@{(NSString *)kCTFontAttributeName: (__bridge id)window_title_font, NSForegroundColorAttributeName: color}];
|
||||
if (!str) { CGContextRelease(ctx); return false; }
|
||||
CTLineRef line = CTLineCreateWithAttributedString((CFAttributedStringRef)str);
|
||||
[str release];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue