mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-30 05:09:12 -07:00
Detect dank mode on Mac OS
This commit is contained in:
15
src/slic3r/Utils/MacDarkMode.hpp
Normal file
15
src/slic3r/Utils/MacDarkMode.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef slic3r_MacDarkMode_hpp_
|
||||
#define slic3r_MacDarkMode_hpp_
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
#if __APPLE__
|
||||
extern bool mac_dark_mode();
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif // MacDarkMode_h
|
||||
22
src/slic3r/Utils/MacDarkMode.mm
Normal file
22
src/slic3r/Utils/MacDarkMode.mm
Normal file
@@ -0,0 +1,22 @@
|
||||
#import "MacDarkMode.hpp"
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@implementation MacDarkMode
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
bool mac_dark_mode()
|
||||
{
|
||||
NSString *style = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
|
||||
return style && [style isEqualToString:@"Dark"];
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user