From 11ea1e36ea0e3c88f99c921dc80c6e09d797b153 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Wed, 30 Nov 2022 17:55:30 +0800 Subject: [PATCH] FIX: [STUDIO-1486] set drawsBackground false for NSTextField Change-Id: I46d6a2812d27e30cf56c037e33bb97d3d063a5b5 --- src/slic3r/GUI/Plater.cpp | 2 -- src/slic3r/Utils/MacDarkMode.mm | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7fe8af428..b22d5d46c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1163,7 +1163,6 @@ void Sidebar::msw_rescale() void Sidebar::sys_color_changed() { -#ifdef _WIN32 wxWindowUpdateLocker noUpdates(this); #if 0 @@ -1192,7 +1191,6 @@ void Sidebar::sys_color_changed() p->frequently_changed_parameters->sys_color_changed(); #endif p->object_settings->sys_color_changed(); -#endif //BBS: remove print related combos #if 0 diff --git a/src/slic3r/Utils/MacDarkMode.mm b/src/slic3r/Utils/MacDarkMode.mm index 2479d8e12..a7662e9dc 100644 --- a/src/slic3r/Utils/MacDarkMode.mm +++ b/src/slic3r/Utils/MacDarkMode.mm @@ -104,7 +104,7 @@ void openFolderForFile(wxString const & file) @end /* textColor for NSTextField */ -@implementation NSTextField (NSTextField_Extended) +@implementation NSTextField (textColor) - (void)setTextColor2:(NSColor *)textColor { @@ -129,6 +129,26 @@ void openFolderForFile(wxString const & file) @end +/* drawsBackground for NSTextField */ +@implementation NSTextField (drawsBackground) + +- (instancetype)initWithFrame2:(NSRect)frameRect +{ + [self initWithFrame2:frameRect]; + self.drawsBackground = false; + return self; +} + + ++ (void) load +{ + Method initWithFrame = class_getInstanceMethod([NSTextField class], @selector(initWithFrame:)); + Method initWithFrame2 = class_getInstanceMethod([NSTextField class], @selector(initWithFrame2:)); + method_exchangeImplementations(initWithFrame, initWithFrame2); +} + +@end + /* textColor for NSButton */ @implementation NSButton (NSButton_Extended)