115 float content_w_ = 0.0f, content_h_ = 0.0f;
116 View* content_ =
nullptr;
117 static constexpr float kBodyPadding = 12.0f;
Definition canvas.hpp:240
CalloutPlacement compute_placement(const Rect &window) const
Resolve the placement against window (typically this overlay's bounds).
void set_preferred_side(CalloutSide s)
Definition callout_box.hpp:81
std::function< void()> on_dismiss
Fired on Escape / outside-click dismiss.
Definition callout_box.hpp:100
static AnchoredCallout * show(View *root, Rect anchor, std::unique_ptr< View > content, CalloutSide preferred=CalloutSide::below, CalloutStyle style={})
Mount as a full-window overlay child of root, anchored to anchor, hosting content.
void set_style(CalloutStyle style)
Definition callout_box.hpp:84
void set_anchor(Rect anchor)
Anchor rect in the window/overlay LOCAL coordinate space.
Definition callout_box.hpp:78
View * content() const
Definition callout_box.hpp:94
Rect anchor() const
Definition callout_box.hpp:79
const CalloutStyle & style() const
Definition callout_box.hpp:85
AnchoredCallout()
Definition callout_box.hpp:75
void layout_children() override
void set_content(std::unique_ptr< View > content)
Attach the content view (ownership moves to the callout).
void paint(canvas::Canvas &canvas) override
CalloutSide preferred_side() const
Definition callout_box.hpp:82
void set_content_size(float w, float h)
The content box size (before the arrow / margins).
Definition callout_box.hpp:89
void set_focusable(bool f)
Definition view.hpp:669
Definition affine_transform.hpp:24
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
CalloutSide opposite_side(CalloutSide s)
Opposite side, used by the auto-flip.
@ s
Definition input_events.hpp:41
@ h
Definition input_events.hpp:39
@ w
Definition input_events.hpp:41
CalloutSide
Which side of the anchor the callout BODY sits on.
Definition callout_box.hpp:34
@ above
Definition callout_box.hpp:34
@ below
Definition callout_box.hpp:34
@ left_of
Definition callout_box.hpp:34
@ right_of
Definition callout_box.hpp:34
CalloutPlacement place_callout(const Rect &anchor, float body_w, float body_h, const Rect &window, CalloutSide preferred, const CalloutStyle &style={})
Place a body_w×body_h callout tethered to anchor, kept inside window.
Resolved placement in the window coordinate space.
Definition callout_box.hpp:49
float arrow_tip_x
triangle tip (touches/points at the anchor)
Definition callout_box.hpp:52
Rect body
the content box
Definition callout_box.hpp:50
float arrow_base_x
center of the triangle base, on the body edge
Definition callout_box.hpp:54
CalloutSide side
side chosen AFTER any auto-flip
Definition callout_box.hpp:51
float arrow_tip_y
Definition callout_box.hpp:53
float arrow_base_y
Definition callout_box.hpp:55
Tunables for the callout geometry. All lengths in the window coordinate space.
Definition callout_box.hpp:40
float margin
minimum gap kept between the body and the window edges
Definition callout_box.hpp:43
float corner_radius
body corner radius (arrow base stays clear of the corners)
Definition callout_box.hpp:45
float gap
extra gap between the anchor and the arrow tip
Definition callout_box.hpp:44
float arrow_length
how far the tip extends past the body edge toward the anchor
Definition callout_box.hpp:41
float arrow_width
base width of the triangle along the body edge
Definition callout_box.hpp:42
Axis-aligned rectangle in continuous (float) coordinates.
Definition geometry.hpp:52