Skip to main content

Module recipe_drop_target_style

Module recipe_drop_target_style 

Source
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§

DropTargetRecipe
Configurable dimensions for RecipeDropTargetStyle.
RecipeDropTargetStyle
Default DropTargetStyle shipped with Teksilo.

Constants§

DROP_TARGET_BORDER_WIDTH_DEFAULT
Border thickness for the Default variant.
DROP_TARGET_BORDER_WIDTH_PROMINENT
Border thickness for the Prominent variant.
DROP_TARGET_BORDER_WIDTH_SUBTLE
Border thickness for the Subtle variant.
DROP_TARGET_CORNER_RADIUS
Corner radius of the overlay’s rounded border.