feat: allow setting roundedCorners on Windows (#45594)

* feat: allow setting roundedCorners on Windows

* Update docs/api/structures/base-window-options.md

Co-authored-by: Will Anderson <will@itsananderson.com>

---------

Co-authored-by: Will Anderson <will@itsananderson.com>
This commit is contained in:
Shelley Vohr 2025-02-20 21:39:12 +01:00 committed by GitHub
parent 5ea885c87f
commit 340fdaf511
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -378,6 +378,11 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
if (!thick_frame_)
frame_style &= ~(WS_THICKFRAME | WS_CAPTION);
::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style);
bool rounded_corner = true;
options.Get(options::kRoundedCorners, &rounded_corner);
if (!rounded_corner)
SetRoundedCorners(false);
}
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);