10#pragma push_macro("None")
212 anchor.offset_x_ = dx;
213 anchor.offset_y_ = dy;
270 double x()
const {
return x_; }
275 double y()
const {
return y_; }
304 double offset_x_ = 0.0;
305 double offset_y_ = 0.0;
312#pragma pop_macro("None")
static Anchor WindowCorner(AnchorCorner corner)
Snap the panel's matching corner to a corner of the window.
Definition Anchor.h:147
AnchorAlign alignment() const
The cross-axis alignment (Below() forms).
Definition Anchor.h:260
Anchor Offset(double dx, double dy) const
Nudge the placement by an offset, applied after the placement form resolves (every form,...
Definition Anchor.h:210
AnchorFit fit_mode() const
The fit behavior (Below() forms).
Definition Anchor.h:265
Kind kind() const
The placement form.
Definition Anchor.h:250
AnchorCorner corner() const
The window corner (WindowCorner() forms).
Definition Anchor.h:255
static Anchor At(double x, double y)
Place the panel's top-left corner at an absolute position in the window.
Definition Anchor.h:132
Anchor Fit(AnchorFit fit) const
Choose the fit behavior when the panel does not fit on its preferred side.
Definition Anchor.h:241
const Rect & rect() const
The anchor rect, in the target panel's local logical px (Below() forms).
Definition Anchor.h:295
Anchor()=default
Create the default placement (the window origin).
static Anchor WindowCenter()
Center the panel in the window.
Definition Anchor.h:157
Anchor Align(AnchorAlign alignment) const
Align the panel against the anchor rect's cross axis.
Definition Anchor.h:226
RefPtr< Panel > target() const
The target panel (Below() forms, null otherwise).
Definition Anchor.h:290
double x() const
The absolute x-position, in logical px (At() forms).
Definition Anchor.h:270
Kind
The placement form.
Definition Anchor.h:112
@ Origin
Window origin (Fill() with the default 100% sizes).
Definition Anchor.h:113
@ WindowCenter
Centered in the window, following the window.
Definition Anchor.h:116
@ WindowCorner
A window corner, following the window.
Definition Anchor.h:115
@ At
Absolute window-space logical px.
Definition Anchor.h:114
@ Below
Under an anchor rect in a target panel.
Definition Anchor.h:117
double offset_y() const
The y-offset applied after the placement form resolves, in logical px.
Definition Anchor.h:285
double offset_x() const
The x-offset applied after the placement form resolves, in logical px.
Definition Anchor.h:280
static Anchor Fill()
Place the panel at the window origin, the named form of the default placement.
Definition Anchor.h:168
double y() const
The absolute y-position, in logical px (At() forms).
Definition Anchor.h:275
static Anchor Below(RefPtr< Panel > target, const Rect &rect)
Place the panel below an anchor rectangle in a target panel (eg, a dropdown below its box).
Definition Anchor.h:192
A layout node that hosts a single web view.
Definition Panel.h:59
A nullable smart pointer.
Definition RefPtr.h:126
Root namespace for every public Ultralight type, function, and enumeration.
AnchorCorner
A window corner.
Definition Anchor.h:22
@ TopRight
Definition Anchor.h:22
@ BottomRight
Definition Anchor.h:22
@ BottomLeft
Definition Anchor.h:22
@ TopLeft
Definition Anchor.h:22
AnchorAlign
Cross-axis alignment of a floating panel against its anchor rect.
Definition Anchor.h:29
@ Center
Definition Anchor.h:29
@ End
Definition Anchor.h:29
@ Start
Definition Anchor.h:29
AnchorFit
Fit behavior when an anchored floating panel does not fit on its preferred side.
Definition Anchor.h:36
@ None
Definition Anchor.h:36
@ Flip
Definition Anchor.h:36
Float Rectangle Helper.
Definition Geometry.h:416
static constexpr Rect MakeEmpty()
Definition Geometry.h:419