fix: increase corner radius for vibrancy view on big sur (#29072)

This commit is contained in:
Shatyuka
2021-05-11 06:11:52 +08:00
committed by GitHub
parent 38020822e1
commit 48605866c4

View File

@@ -1580,7 +1580,12 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
// Make frameless Vibrant windows have rounded corners.
if (!has_frame() && !is_modal()) {
CGFloat radius = 5.0f; // default corner radius
CGFloat radius;
if (@available(macOS 11.0, *)) {
radius = 9.0f;
} else {
radius = 5.0f; // smaller corner radius on older versions
}
CGFloat dimension = 2 * radius + 1;
NSSize size = NSMakeSize(dimension, dimension);
NSImage* maskImage = [NSImage imageWithSize:size