Expand description
Default DropTargetStyle impl driven by paint-recipe data.
RecipeDropTargetStyle ships the IntUI drop-target chrome: the wrapped
child fills the bounds and stays fully visible; a full-bleed RectWidget
strokes a reactive rounded whole-bounds border (error on reject, accent
on a Center accept — no fill, an opaque tint would hide the child); a
DropRegionOverlay paints the active side zone’s highlight (an edge
strip → translucent fill + accent frame) and hosts the per-region hint cards;
and each hint is a popup Card centered within its region’s rect, shown only
while that zone is the active accepted-hover.
The overlay layout (a ZStack of child + reject-rect + region-overlay) never
inflates the stack’s intrinsic size: RectWidget and DropRegionOverlay
report 0×0 for an unspecified proposal and fill an exact one, so the target
sizes to exactly the wrapped child. The DropTarget widget sets
clips_children, keeping an oversized hint card inside its zone.
Each hint is gated with [BuildContext::visible_when] on a derived
“is this region the active accepted-hover?” signal: it culls both paint
and the accessibility node when its zone isn’t active, so a screen reader
never meets an inactive zone’s prompt. Live::Polite on the card announces
it appearing.
The decorative chrome (the reject-border RectWidget and, when the target
declares no hints, the DropRegionOverlay) is hidden from the AT tree —
a hint-less multi-zone target (e.g. a docking pane) adds no empty container
per drop target.
Apps wanting a different look (dashed border, translucent wash, glow, no
popup) write their own impl DropTargetStyle block and install it per-call
(DropTarget::style(...)) or theme-wide
(theme.style_slots.drop_target = Some(Rc::new(...))). The
DropTargetDragState::surface_role helper is there for styles that do
want a (translucent) fill.
Structs§
- Drop
Target Recipe - Configurable dimensions for
RecipeDropTargetStyle. - Recipe
Drop Target Style - Default
DropTargetStyleshipped with Teksilo.
Constants§
- DROP_
TARGET_ BORDER_ WIDTH_ DEFAULT - Border thickness for the
Defaultvariant. - DROP_
TARGET_ BORDER_ WIDTH_ PROMINENT - Border thickness for the
Prominentvariant. - DROP_
TARGET_ BORDER_ WIDTH_ SUBTLE - Border thickness for the
Subtlevariant. - DROP_
TARGET_ CORNER_ RADIUS - Corner radius of the overlay’s rounded border.