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:
parent
750a762bf0
commit
f9d2a7077e
11 changed files with 104 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "ui/gfx/geometry/point.h"
|
||||
#include "ui/gfx/geometry/point_f.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/geometry/resize_utils.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
|
||||
namespace gin {
|
||||
|
@ -160,4 +161,29 @@ v8::Local<v8::Value> Converter<display::Display>::ToV8(
|
|||
return dict.GetHandle();
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> Converter<gfx::ResizeEdge>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
const gfx::ResizeEdge& val) {
|
||||
switch (val) {
|
||||
case gfx::ResizeEdge::kRight:
|
||||
return StringToV8(isolate, "right");
|
||||
case gfx::ResizeEdge::kBottom:
|
||||
return StringToV8(isolate, "bottom");
|
||||
case gfx::ResizeEdge::kTop:
|
||||
return StringToV8(isolate, "top");
|
||||
case gfx::ResizeEdge::kLeft:
|
||||
return StringToV8(isolate, "left");
|
||||
case gfx::ResizeEdge::kTopLeft:
|
||||
return StringToV8(isolate, "top-left");
|
||||
case gfx::ResizeEdge::kTopRight:
|
||||
return StringToV8(isolate, "top-right");
|
||||
case gfx::ResizeEdge::kBottomLeft:
|
||||
return StringToV8(isolate, "bottom-left");
|
||||
case gfx::ResizeEdge::kBottomRight:
|
||||
return StringToV8(isolate, "bottom-right");
|
||||
default:
|
||||
return StringToV8(isolate, "unknown");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace gin
|
||||
|
|
|
@ -16,6 +16,7 @@ class Point;
|
|||
class PointF;
|
||||
class Size;
|
||||
class Rect;
|
||||
enum class ResizeEdge;
|
||||
} // namespace gfx
|
||||
|
||||
namespace gin {
|
||||
|
@ -62,6 +63,12 @@ struct Converter<display::Display> {
|
|||
display::Display* out);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<gfx::ResizeEdge> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const gfx::ResizeEdge& val);
|
||||
};
|
||||
|
||||
} // namespace gin
|
||||
|
||||
#endif // SHELL_COMMON_GIN_CONVERTERS_GFX_CONVERTER_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue