feat: expose window.invalidateShadow() (#32452)

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Shelley Vohr 2022-12-01 19:24:44 +01:00 committed by GitHub
parent 35a7c07306
commit d092e6bda4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 2 deletions

View file

@ -226,8 +226,8 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
NSUInteger styleMask = NSWindowStyleMaskTitled;
// Removing NSWindowStyleMaskTitled removes window title, which removes
// rounded corners of window.
// The NSWindowStyleMaskFullSizeContentView style removes rounded corners
// for frameless window.
bool rounded_corner = true;
options.Get(options::kRoundedCorners, &rounded_corner);
if (!rounded_corner && !has_frame())
@ -1061,6 +1061,10 @@ bool NativeWindowMac::HasShadow() {
return [window_ hasShadow];
}
void NativeWindowMac::InvalidateShadow() {
[window_ invalidateShadow];
}
void NativeWindowMac::SetOpacity(const double opacity) {
const double boundedOpacity = base::clamp(opacity, 0.0, 1.0);
[window_ setAlphaValue:boundedOpacity];