pub struct PlatformViewView { /* private fields */ }Expand description
A declarative platform-view slot. See the module docs.
Implementations§
Source§impl PlatformViewView
impl PlatformViewView
Sourcepub fn params_json(self, params_json: impl Into<String>) -> Self
pub fn params_json(self, params_json: impl Into<String>) -> Self
Set the opaque creation params handed to the native factory (default
empty). Changing this across a rebuild bumps the widget’s retained
params_generation counter exactly once (see the module’s Identity
notes) — the differ uses the bump to decide whether to
re-create or merely update the native view.
Sourcepub fn size(self, width: f64, height: f64) -> Self
pub fn size(self, width: f64, height: f64) -> Self
Force an explicit (width, height) slot size, clamped into whatever
constraints this widget’s parent hands it. Overrides
PlatformViewView::expand when called after it (last builder call
wins, matching the crate’s other size-mode builders).
Sourcepub fn expand(self) -> Self
pub fn expand(self) -> Self
Fill the incoming constraints’ maximum — the default (see
[SlotSize::Expand]), provided as an explicit builder call for
readability at call sites that want to make the choice visible.
Sourcepub fn debug_fill(self) -> Self
pub fn debug_fill(self) -> Self
Debug aid: paint a translucent magenta slab over the slot’s bounds
(see [DEBUG_FILL_COLOR]) so the reserved region is visible even
with no native host attached — invaluable on desktop, where a
platform view never actually composites. Compiled only into debug
builds, so it can never ship live in a release binary.
Sourcepub fn semantics_label(self, label: impl Into<String>) -> Self
pub fn semantics_label(self, label: impl Into<String>) -> Self
Attach a plain accessible label over the slot’s bounds (a
Role::GenericContainer semantics node) — the v1 accessibility-gap
mitigation: the native view itself carries no frust-visible
semantics, so this is the only signal an assistive technology gets
for the region.
Sourcepub fn interactive(self) -> Self
pub fn interactive(self) -> Self
Mode B input forwarding: mark this slot’s
native view as pointer-interactive. A touch-DOWN inside the slot’s
rect — and outside every shield rect (Self::shield_local) — hands
the whole gesture to the native sibling instead of the frust surface.
Default off (the v1 no-input contract).
Sourcepub fn shield_local(self, rect: Rect) -> Self
pub fn shield_local(self, rect: Rect) -> Self
Declare a slot-relative region where frust content drawn OVER this slot must keep receiving input (the z-shield).
The manual escape hatch, not the ordinary path. Wrap the frust
chrome in shield instead: a shield(child) reports the rect it
actually painted every frame, so it can’t drift out of sync with a
moving/resizing widget the way a hand-written rect does. Reach for this
builder only for a region no widget paints (a reserved gutter, a
gesture-only zone). Both sources are honored — the shell-side differ
unions a slot’s manual rects with the intersecting auto-collected ones.
The rect is slot-relative; the widget translates it into absolute window coordinates when it publishes its frame.
Trait Implementations§
Source§impl<State: 'static> View<State> for PlatformViewView
impl<State: 'static> View<State> for PlatformViewView
Source§type Element = PlatformViewWidget
type Element = PlatformViewWidget
Source§fn build(&self, _ctx: &mut BuildCtx<'_>) -> PlatformViewWidget
fn build(&self, _ctx: &mut BuildCtx<'_>) -> PlatformViewWidget
Source§fn rebuild(
&self,
prev: &Self,
element: &mut PlatformViewWidget,
_ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut PlatformViewWidget, _ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.