mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: include resize edge with will-resize event (#29199)
* feat: emit resize edge with will-resize event fix: wparam type fix: private member usage on mac docs: will-resize event edge option refactor: 'info' -> 'details' for better type gen * Update docs/api/browser-window.md Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> * Update docs/api/browser-window.md Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
@@ -206,8 +206,15 @@ void BaseWindow::OnWindowRestore() {
|
||||
}
|
||||
|
||||
void BaseWindow::OnWindowWillResize(const gfx::Rect& new_bounds,
|
||||
const gfx::ResizeEdge& edge,
|
||||
bool* prevent_default) {
|
||||
if (Emit("will-resize", new_bounds)) {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::Locker locker(isolate);
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
gin_helper::Dictionary info = gin::Dictionary::CreateEmpty(isolate);
|
||||
info.Set("edge", edge);
|
||||
|
||||
if (Emit("will-resize", new_bounds, info)) {
|
||||
*prevent_default = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user