mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: add NativeWindow::SetShape() (#47131)
use NativeWindow::SetShape() in api::BaseWindow
This commit is contained in:
@@ -289,6 +289,10 @@ NativeWindow* NativeWindow::FromWidget(const views::Widget* widget) {
|
||||
widget->GetNativeWindowProperty(kNativeWindowKey.c_str()));
|
||||
}
|
||||
|
||||
void NativeWindow::SetShape(const std::vector<gfx::Rect>& rects) {
|
||||
widget()->SetShape(std::make_unique<std::vector<gfx::Rect>>(rects));
|
||||
}
|
||||
|
||||
void NativeWindow::SetSize(const gfx::Size& size, bool animate) {
|
||||
SetBounds(gfx::Rect(GetPosition(), size), animate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user