mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Enumerate screens and calculate maximum screen scaling.
This commit is contained in:
parent
8c862ade29
commit
5161dc43d6
2 changed files with 12 additions and 0 deletions
|
@ -6,6 +6,7 @@ namespace GUI {
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
extern bool mac_dark_mode();
|
extern bool mac_dark_mode();
|
||||||
|
extern double mac_max_scaling_factor();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,17 @@ bool mac_dark_mode()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue