PrusaSlicer-NonPlainar/src/slic3r/Utils/MacDarkMode.mm

34 lines
675 B
Plaintext
Raw Normal View History

2019-04-26 14:59:14 +00:00
#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"];
}
double mac_max_scaling_factor()
{
double scaling = 1.;
if ([NSScreen screens] == nil) {
scalign = [[NSScreen mainScreen] backingScaleFactor];
} else {
for (int i = 0; i < [[NSScreen screens] count]; ++ i)
scaling = std::max<double>(scaling, [[[NSScreen screens] objectAtIndex:0] backingScaleFactor]);
}
return scalign;
}
2019-04-26 14:59:14 +00:00
}
}
@end