pub struct SceneView { /* private fields */ }Expand description
A pannable/zoomable viewport that renders a Scene’s items at scene
coordinates and routes user input (scroll, pinch, drag, keyboard) back into
the camera signals.
Construct with SceneView::new (single-view sugar: wraps a Scene in a
fresh SceneModel) or SceneView::with_model (multi-view: several
viewports share one SceneModel and each reconcile independently on every
mutation). Install a heavyweight builder for delegated items via
delegate_typed. Add to a WidgetTree
like any other widget; gestures and camera animations are wired automatically
during build.
See the module-level documentation for the full composition model
and docs/teksilo-scene.md for an end-to-end guide.
Implementations§
Source§impl SceneView
impl SceneView
Sourcepub fn new(scene: Scene) -> Self
pub fn new(scene: Scene) -> Self
Wrap a Scene in a viewport (single-view sugar). The scene is moved
into a fresh SceneModel; for multi-view, build a SceneModel
yourself and use with_model.
Sourcepub fn with_model(model: SceneModel) -> Self
pub fn with_model(model: SceneModel) -> Self
Attach a viewport to a (possibly shared) SceneModel. Clone one
model into several SceneView::with_model(model.clone()) to render the
same scene in multiple panes, each with its own camera and delegate.
Sourcepub fn selection_mode(self, mode: SceneSelectionMode) -> Self
pub fn selection_mode(self, mode: SceneSelectionMode) -> Self
Configure selection behavior. Default
SceneSelectionMode::None —
click and marquee do nothing. Set to Single for
at-most-one selection (click replaces) or Multi for
multi-select with marquee box-select, Ctrl+click toggle,
and Ctrl+drag additive marquee.
Sourcepub fn marquee_selection_mode(self, mode: ItemSelectionMode) -> Self
pub fn marquee_selection_mode(self, mode: ItemSelectionMode) -> Self
Which rule the rubber band picks items by.
Default ItemSelectionMode::IntersectsItemShape —
Qt’s default, and the one that makes a rubber band agree with a click
about what an item is: a band that merely grazes a connector’s bounding
box no longer selects the connector, it has to actually cross the
stroke. Pass
IntersectsItemBoundingRect
for the looser box test, which is what the marquee did before
ItemShape existed.
Sourcepub fn selection(&self) -> &SceneSelection
pub fn selection(&self) -> &SceneSelection
Borrow the SceneView’s SceneSelection.
Use this from external code to bind to the selection signal,
query selected ids, or call select_one / clear /
replace programmatically.
Sourcepub fn delegate(
self,
f: impl Fn(&dyn Any, ItemId) -> Box<dyn Widget> + 'static,
) -> Self
pub fn delegate( self, f: impl Fn(&dyn Any, ItemId) -> Box<dyn Widget> + 'static, ) -> Self
Install the per-view heavyweight builder for Delegated items
(those added via SceneModel::add_widget_item).
The closure receives the item’s type-erased payload and its ItemId
and returns the widget to materialise in this view’s arena.
Prefer the typed delegate_typed wrapper.
Sourcepub fn delegate_typed<P: 'static>(
self,
f: impl Fn(&P, ItemId) -> Box<dyn Widget> + 'static,
) -> Self
pub fn delegate_typed<P: 'static>( self, f: impl Fn(&P, ItemId) -> Box<dyn Widget> + 'static, ) -> Self
Typed convenience over delegate: downcasts the
payload to P before calling f. A downcast miss debug-asserts and
skips the item (no widget is materialised) in release.
Sourcepub fn selection_model(self, selection: SceneSelection) -> Self
pub fn selection_model(self, selection: SceneSelection) -> Self
Replace this view’s selection with a (typically shared) one. Pass the
same SceneSelection clone to several views so
they select together; capture its selection_signal() in your delegate
to highlight selected items reactively (no rebuild). Distinct from the
selection() getter; supersedes any
selection_mode set earlier.
Sourcepub fn model(&self) -> SceneModel
pub fn model(&self) -> SceneModel
A clone of this view’s SceneModel handle — for handler closures
that mutate the scene (every mutator is &self) or wire additional views.
Sourcepub fn model_ref(&self) -> &SceneModel
pub fn model_ref(&self) -> &SceneModel
Borrow this view’s SceneModel handle.
Sourcepub fn flush_marquee_commit(&self) -> bool
pub fn flush_marquee_commit(&self) -> bool
Drain any pending marquee commit synchronously. Normal
per-frame use never needs this — place_children consumes
the pending commit at the start of every layout pass. Tests
that drive on_drag without a follow-up layout call this to
materialise the box-select result.
Sourcepub fn flush_pending_item_move(&mut self) -> bool
pub fn flush_pending_item_move(&mut self) -> bool
Drain any pending drag-to-move commit by translating the
dragged item’s local_pos by the queued delta. Descendants
follow automatically: their local_pos is unchanged but
their scene_pos derives from the parent’s chain.
Sourcepub fn flush_pending_transform(&mut self) -> bool
pub fn flush_pending_transform(&mut self) -> bool
Drain a committed transform, applying its delta through one
Scene::apply_transform_delta.
The same drain build() runs; the public form exists for the headless
driver, exactly like flush_pending_item_move
and flush_marquee_commit. Returns whether
anything was pending.
Sourcepub fn interactive(self, interactive: bool) -> Self
pub fn interactive(self, interactive: bool) -> Self
Disable user-driven navigation: pinch and keyboard handlers are not
registered, the scroll handler’s wheel arm returns early, and the
SceneView is not made focusable. The on_scroll slot itself stays
registered, because it also carries a descendant’s ScrollIntoView
reveal — a focused caret inside an embedded card is entitled to be on
screen whether or not the user may drive the camera. Programmatic
pan_to /
zoom_to / fit_to_content
still work — this gates only user input.
Use this for outer SceneViews in nested chart-style
patterns: an outer locked SceneView holds axis chrome
(TextItems reading the inner’s pan/zoom signals via
view_transform_signal),
an inner interactive SceneView holds the data and accepts
pan/zoom from the user. Default: interactive (true).
Sourcepub fn nested_a11y(self, nested: bool) -> Self
pub fn nested_a11y(self, nested: bool) -> Self
Mark this SceneView as logically nested inside another
SceneView. Affects only the AT walker — the inner
SceneView reports Role::Region instead of the default
Role::Pane, so screen readers don’t announce a
redundant top-level landmark for what’s logically a sub-
region. Pair with a11y_label to give
the inner region a useful announce name.
Use case: chart-style nested scenes (outer SceneView holds axis chrome, inner SceneView holds data) — the inner one should announce as “Data area” or similar, not as another “Pane” sibling to the outer.
Default false. Apps explicitly set this when they know
they’re nesting; the framework doesn’t introspect the
widget tree to detect nesting automatically (deliberately
kept declarative — the visual layout doesn’t always match
logical nesting).
Sourcepub fn a11y_label(self, label: impl Into<LocalizedString>) -> Self
pub fn a11y_label(self, label: impl Into<LocalizedString>) -> Self
Set the AT label announced as this SceneView’s own name.
Particularly useful for nested SceneViews via
nested_a11y, where the inner
region should have a domain-specific name (e.g. “Chart
data area”). Default None — the SceneView has no
explicit AT name.
Sourcepub fn is_nested(&self) -> bool
pub fn is_nested(&self) -> bool
Whether the SceneView is currently marked as logically nested. Read-only accessor for tests / diagnostics.
Sourcepub fn debug_overlay(self, overlay: DebugOverlay) -> Self
pub fn debug_overlay(self, overlay: DebugOverlay) -> Self
Configure visual debug overlays. Default: all flags off.
Pass DebugOverlay::ALL to enable every overlay or
construct a custom config:
let _view = SceneView::new(scene)
.debug_overlay(DebugOverlay {
item_bounds: true,
viewport: true,
..Default::default()
});Intended for development only — overlay paint is cheap but not free; ship with the default (off) config.
Sourcepub fn current_debug_overlay(&self) -> DebugOverlay
pub fn current_debug_overlay(&self) -> DebugOverlay
Read-only accessor for the active debug overlay config.
Sourcepub fn focus_order<F>(self, callback: F) -> Self
pub fn focus_order<F>(self, callback: F) -> Self
Install a custom focus-order callback. When set,
next_focus /
previous_focus route through the
closure instead of falling back to scene insertion order.
Apps wire this to a Tab / Shift+Tab handler in their root shortcut/action map. Typical implementations:
- Graph editor: walk outgoing-port connections from the
current node, return the connected-node
ItemId. - Corkboard with Acts: walk a parallel
BTreeMap<ActId, Vec<CardId>>declared by the app and Tab through cards in story order, not reading order. - Timeline: sort items by
start_time, return the next.
The callback receives the full Scene (read-only), the
requested FocusDirection, and the currently focused item
(None on the first Tab into the scene). Return None to
signal “no next item” (the framework can then advance focus
outside the SceneView).
Calling next_focus /
previous_focus without a callback
installed walks scene insertion order — adequate for simple
scenes; replace as needed.
Sourcepub fn focus_in_direction(
&self,
direction: FocusDirection,
current: Option<ItemId>,
) -> Option<ItemId>
pub fn focus_in_direction( &self, direction: FocusDirection, current: Option<ItemId>, ) -> Option<ItemId>
Compute the next item the focus should advance to in the
given direction. If a focus_order
callback is installed, routes through it; otherwise falls
back to scene insertion order — Forward returns the item
after current (or the first if current is None),
Backward returns the previous (or the last if current
is None).
Sourcepub fn next_focus(&self, current: Option<ItemId>) -> Option<ItemId>
pub fn next_focus(&self, current: Option<ItemId>) -> Option<ItemId>
Convenience: forward-Tab traversal. See
focus_in_direction.
Sourcepub fn previous_focus(&self, current: Option<ItemId>) -> Option<ItemId>
pub fn previous_focus(&self, current: Option<ItemId>) -> Option<ItemId>
Convenience: backward-Tab (Shift+Tab) traversal. See
focus_in_direction.
Sourcepub fn pan_x_signal(&self) -> Signal<f32>
pub fn pan_x_signal(&self) -> Signal<f32>
Live Signal<f32> for the X pan offset. Use this from a
parent scene (or any reactive consumer) to derive values
that follow the SceneView’s pan — typically axis-label
text in a chart-style outer SceneView.
Sourcepub fn pan_y_signal(&self) -> Signal<f32>
pub fn pan_y_signal(&self) -> Signal<f32>
Live Signal<f32> for the Y pan offset.
Sourcepub fn zoom_signal(&self) -> Signal<f32>
pub fn zoom_signal(&self) -> Signal<f32>
Live Signal<f32> for the zoom factor.
Sourcepub fn rotation_signal(&self) -> Signal<f32>
pub fn rotation_signal(&self) -> Signal<f32>
Live Signal<f32> for the rotation in radians.
Sourcepub fn view_transform_signal(&self) -> Signal<Transform2D>
pub fn view_transform_signal(&self) -> Signal<Transform2D>
Live Signal<Transform2D> for the composed view transform
(pan + zoom + rotation + bounds-origin). Folds in the
bounds.origin contribution so reactive consumers see the
exact transform the renderer applies. Updated whenever any
of the underlying signals change. Use this when the
consumer needs the full matrix (e.g. converting a screen
point to scene coords from outside the SceneView).
Sourcepub fn a11y_mode(self, mode: A11yMode) -> Self
pub fn a11y_mode(self, mode: A11yMode) -> Self
Override the A11yMode for this
SceneView. Default is Cooperative — the visual scene
layout drives AT emission unless explicitly overridden via
Scene::set_a11y_parent.
Switch to StrictlyParallel when your app’s AT shape is
fundamentally different from its visual layout: items
without a declared logical parent are then suppressed from
the AT tree, and the app declares every node it wants AT
users to reach.
Sourcepub fn retention_margin(self, screen_px: f32) -> Self
pub fn retention_margin(self, screen_px: f32) -> Self
How far past the viewport edge, in screen pixels, a heavyweight
card stays live. Default DEFAULT_RETENTION_MARGIN (96).
A card outside the retention region — the viewport grown by this
margin, unioned with whatever
a11y_off_screen_mode asks to be
listed — is parked dormant. It leaves paint, the layout recursion, the
AccessKit tree and the Tab ring, and keeps its focus, text and
animation state for when the camera brings it back.
It is a lifecycle knob, not an accessibility one. Raising it does
not offer assistive technology more of the scene: how much of it a
screen reader is enumerated is decided by
a11y_off_screen_mode alone. A card in
the margin band but outside that mode’s region is alive and unlisted —
laid out, Tab-reachable, holding its state, absent from the AccessKit
tree. Landing focus on it publishes it, in the same pass.
Screen pixels, not scene units, converted through the current zoom each pass, so the margin is a constant on-screen distance at every zoom level. That is what it has to be: a pan covers screen distance, not scene distance, and the margin’s job is to have woken a card before the camera reaches it. At zoom 0.1 the default is 960 scene units.
Three regions, not one, and they are layered: the tight viewport decides who is laid out at full size versus collapsed to zero (unchanged, zero margin), the accessibility region decides who is enumerated, and this widest one decides who is dormant. Each contains the one before it by construction — so a card being laid out is never also parked, and the AT walk is never asked to describe a card the arena has parked.
Raising this keeps more cards live — more Tab stops, more layout recursion, more state held; lowering it parks closer to the edge. Zero is legal and means “park at the viewport edge”; a card entering is still woken and laid out in the same pass, so nothing is ever a frame late, but every crossing then pays a wake.
Sourcepub fn current_retention_margin(&self) -> f32
pub fn current_retention_margin(&self) -> f32
The current retention margin in screen pixels.
Sourcepub fn a11y_off_screen_mode(self, mode: A11yOffScreenMode) -> Self
pub fn a11y_off_screen_mode(self, mode: A11yOffScreenMode) -> Self
Override the off-screen visibility policy for the AT walker — how much of a scene that runs past the viewport a screen reader is offered.
Default: ViewportPlusN { n: 1 } — everything inside the viewport plus
a one-screen margin on each side. AllItems for small scenes where AT
users want a complete table of contents (nothing is ever parked in that
mode, so it costs what it promises); ViewportOnly for very large
scenes, where listing off-screen content would bury an AT client.
This governs both tiers — lightweight items and heavyweight cards —
and it is the only thing that does.
retention_margin can keep a card alive past
this region, for the camera’s sake, without adding it here.
Sourcepub fn default_size(self, w: f32, h: f32) -> Self
pub fn default_size(self, w: f32, h: f32) -> Self
Override the size used when the parent doesn’t propose one on an axis. Defaults to 800×600 logical pixels.
Sourcepub fn adopt_scene_size(self, on: bool) -> Self
pub fn adopt_scene_size(self, on: bool) -> Self
When set, the view’s layout_response returns the scene’s
scene_rect_extent as its own wanted size — the view sizes
itself to its scene rather than to default_size. Pairs
naturally with Scene::pan_axes / Scene::zoomable
to embed bounded, non-navigable scenes inline (mini diagrams,
fixed corkboards). Default false.
Sourcepub fn drag_mode(self, mode: impl Into<Prop<DragMode>>) -> Self
pub fn drag_mode(self, mode: impl Into<Prop<DragMode>>) -> Self
Configure how left-mouse drag-on-canvas behaves. Default
DragMode::RubberBand — drag-on-an-item
moves it (when IS_DRAGGABLE), drag-on-empty-space creates
a marquee. DragMode::ScrollHandDrag makes left-drag
pan the view unconditionally; DragMode::NoDrag disables
the on-drag handler entirely.
Accepts a static DragMode — which sets the current value on the
view’s internal signal — or a Signal<DragMode> (via
impl Into<Prop<DragMode>>), which replaces the internal signal
with the app-owned one so a toolbar can hold the same handle and
toggle Hand vs Select vs NoDrag at runtime. To stop sharing, pass a
fresh Signal::new(mode).
Sourcepub fn view_state(
self,
pan_x: Signal<f32>,
pan_y: Signal<f32>,
zoom: Signal<f32>,
rotation: Signal<f32>,
) -> Self
pub fn view_state( self, pan_x: Signal<f32>, pan_y: Signal<f32>, zoom: Signal<f32>, rotation: Signal<f32>, ) -> Self
Replace the view’s pan / zoom / rotation signals with app-owned ones.
The four view-state signals become the app’s to hold, share, and
persist — so view state survives a rebuild-from-state (a wrapper that
reconstructs the Scene + SceneView keeps the same signals and the
viewport doesn’t jump back to the origin), a “Reset View” button can
snap them, and two views could share one camera. The derived
view_transform_signal is recomposed
from the injected signals.
Must be called before the view is added to the tree (like the other
builder methods) — build() reads view_transform_signal once.
Sourcepub fn initial_pan(self, x: f32, y: f32) -> Self
pub fn initial_pan(self, x: f32, y: f32) -> Self
Seed the initial pan offset (logical pixels). The view keeps ownership
of the signals; for app-owned signals use view_state.
Sourcepub fn initial_zoom(self, zoom: f32) -> Self
pub fn initial_zoom(self, zoom: f32) -> Self
Seed the initial zoom factor (clamped to the active zoom range).
Sourcepub fn initial_rotation(self, radians: f32) -> Self
pub fn initial_rotation(self, radians: f32) -> Self
Seed the initial rotation (radians).
Sourcepub fn drag_mode_signal(&self) -> Signal<DragMode>
pub fn drag_mode_signal(&self) -> Signal<DragMode>
Reactive accessor for the drag mode. Useful for toolbars that need to read the current mode (e.g. to highlight the active tool button) and write to it.
Sourcepub fn background<F>(self, paint: F) -> Selfwhere
F: Fn(&mut Canvas, &PaintContext<'_>, Rect) + 'static,
pub fn background<F>(self, paint: F) -> Selfwhere
F: Fn(&mut Canvas, &PaintContext<'_>, Rect) + 'static,
Install a closure painted before the items walk. The
canvas already has the view-transform scope pushed, so the
closure paints in scene coords. The Rect argument is the
scene-coord visible region — useful for tiled backgrounds
(graph-paper grids, ruled lines, dot grids) so the closure
only emits geometry the user can actually see.
SceneView::new(scene).background(|canvas, _ctx, region| {
// Draw a 50-unit grid covering only the visible region.
let step = 50.0;
let x0 = (region.x / step).floor() * step;
let mut x = x0;
while x < region.x + region.width {
canvas.draw_line(/* ... */);
x += step;
}
})Sourcepub fn foreground<F>(self, paint: F) -> Selfwhere
F: Fn(&mut Canvas, &PaintContext<'_>, Rect) + 'static,
pub fn foreground<F>(self, paint: F) -> Selfwhere
F: Fn(&mut Canvas, &PaintContext<'_>, Rect) + 'static,
Install a closure painted after the items walk and the
marquee, but before any debug overlay. Same coordinate
conventions as background. Used for
scene-coord chrome that should ride over content (rulers,
snap-line indicators, drop hints).
Sourcepub fn wet_layer(self, layer: WetLayer) -> Self
pub fn wet_layer(self, layer: WetLayer) -> Self
Install a WetLayer — a surface for content being
authored right now, which repaints without taking the scene’s item
bands with it.
Its node is always the last child of this view, so wet content sits
above every card and every
Interleaved item, and under the
Over band and the view’s own chrome (marquee, magnet feedback,
transform frame, debug overlay).
Unlike foreground, which runs inside the view’s
own post_paint and therefore cannot be invalidated without repainting
the whole Under band with it, this is a node of its own:
WetLayer::request_repaint marks it
and nothing else.
Paint-only, hidden from assistive technology and transparent to the
pointer — see WetLayer.
The same layer may be installed in several views: each mounts its
own node and paints the same painter, the way several views share one
SceneModel. Mounting it in a second view does not
unmount it from the first.
Sourcepub fn magnetism(self, config: MagnetismConfig) -> Self
pub fn magnetism(self, config: MagnetismConfig) -> Self
Enable magnetism on this view with the given
MagnetismConfig.
Once installed, this view’s lightweight item drags snap their magnets onto compatible magnets on other items, magnet handles become grabbable for port-drag wires, the keyboard connect flow (the config’s connect key) is available while the view is focused, magnet markers paint, and each enabled magnet is emitted as a synthetic AT node. A view with no magnetism config ignores magnets entirely.
Sourcepub fn transform_controller(self, config: TransformConfig) -> Self
pub fn transform_controller(self, config: TransformConfig) -> Self
Install the selection transform controller on this view: a frame with resize and rotate handles drawn around the selection, a group move, a keyboard route, and accessibility nodes for all of it.
Nothing about the view changes until this is called — with no controller the pointer rules are exactly what they were.
Where the gesture may land is not this controller’s business: it is
the scene’s, through
SceneModel::set_geometry_constraint,
which every gesture here consults on every sample. Snap-to-grid, axis
lock and page clamping live there, once for the document, rather than
once per view.
§What a gesture writes, and when
Nothing, until the release. The session is per-view and model-free: it
reads SceneSelection, paints a preview, and
then writes the scene once, through a single
Scene::apply_transform_delta.
So Esc is “drop the session” with no rollback to get wrong, a ten-item
selection emits no ItemChange at all until it lands, and an app that
wants the edit to be reversible has exactly one call to record — from
TransformConfig::on_end. The history itself is the data layer’s, not
this crate’s.
§Which handles appear
Exactly the operations that will be honoured, never more:
| Operation | Flag | Offered when |
|---|---|---|
| Move | IS_DRAGGABLE | any selection root carries it (the others stay put) |
| Resize | IS_RESIZABLE | every selection root carries it |
| Rotate | IS_ROTATABLE | every selection root carries it and is lightweight |
Resize and rotate demand unanimity because a partial one would tear the selection apart — the locked members would stand still while the rest scaled, and the frame would stop describing what it is drawn around. A move can be partial because that is what every editor does with a locked object.
The flags are honoured, not bypassed: a default ItemFlags carries
IS_SELECTABLE and not IS_DRAGGABLE, so selecting a decorative item
does not quietly make it draggable.
§Reaching the chrome over a heavyweight card
The frame is drawn padding outside the
selection, so the band and every handle sit on pixels no card owns. That
matters because a card that claims its own press — one calling
capture_pointer, or carrying its own on_drag, which is every
Splitter handle, SpinBox step button and TextInput selection drag —
wins that press by design, and this view never sees the gesture. So
body drag over a card is best-effort and the frame band is the route
that always works. Over the lightweight tier, and over a card that
claims nothing, both work.
§Keyboard and assistive technology
t (see TransformConfig::transform_key) enters a handle-roving
mode: Tab / Shift+Tab move between the handles the frame is
offering, arrows drive the roved one (Shift ×10), Enter commits,
Esc cancels, t leaves. The frame and each handle are published as
accessibility nodes with Increment / Decrement, and both routes go
through the same session and the same commit — so the non-drag
alternative makes the same model change the drag makes, structurally.
let view = SceneView::new(Scene::new())
.selection_mode(SceneSelectionMode::Multi)
.transform_controller(TransformConfig::new().keep_ratio(true));Sourcepub fn transform_session_signal(&self) -> Signal<Option<TransformSession>>
pub fn transform_session_signal(&self) -> Signal<Option<TransformSession>>
The live transform session, for an app-owned inspector, status bar or
size readout. None between gestures. Bind at
[BindingLevel::RepaintOnly].
Republished on every input sample — each pointer move, each keyboard step, and at the start and end of a gesture. It is deliberately not republished per frame: during an edge auto-pan the pointer is standing still while the view slides under it, so the frame keeps changing with no sample to hang a republish on, and a readout bound here shows the last sampled numbers until the pointer moves again. What is committed is always the live resolution, so this lags the frame rather than disagreeing with the result.
Sourcepub fn transform_enabled_signal(&self) -> Option<Signal<bool>>
pub fn transform_enabled_signal(&self) -> Option<Signal<bool>>
The reactive enabled signal of the installed transform controller, if any — for a toolbar to read or bind a “transform tools” toggle.
Sourcepub fn magnetism_enabled_signal(&self) -> Option<Signal<bool>>
pub fn magnetism_enabled_signal(&self) -> Option<Signal<bool>>
The reactive enabled signal of the installed magnetism config, if any — for a toolbar to read or bind a magnetism on/off toggle.
Sourcepub fn invalidate_item_cache(&self, id: ItemId)
pub fn invalidate_item_cache(&self, id: ItemId)
Drop the cached paint output for id. Apps that mutate
item-internal state without going through a Scene mutator
(e.g. a custom item whose paint depends on a private
Signal<Color> that doesn’t drive local_bounds) call this
to invalidate. The cache is otherwise dropped automatically
on LocalBoundsChanged / ItemReplaced / AppearanceChanged /
MeasuredSizeChanged / an IS_ENABLED FlagsChanged / Removed —
but never on opacity / transform / z / local_pos, which are applied
as wrapping scopes at replay and don’t bake into a cached frame.
Sourcepub fn item_cache_len(&self) -> usize
pub fn item_cache_len(&self) -> usize
Number of cached entries currently held. Diagnostic / test hook — apps shouldn’t normally need this.
Sourcepub fn min_zoom(self, v: f32) -> Self
pub fn min_zoom(self, v: f32) -> Self
Minimum zoom factor (default 0.1×). Applied as a clamp to all
programmatic and gesture-driven zoom changes via the
view-level zoom_range_override.
Shim — updates the lower bound of the override range. The
effective clamp is the intersection of Scene-level
Scene::set_zoom_range and
this override (tightening-only — neither side can loosen).
Sourcepub fn max_zoom(self, v: f32) -> Self
pub fn max_zoom(self, v: f32) -> Self
Maximum zoom factor (default 10×). Shim — updates the upper
bound of the override range. See min_zoom.
Sourcepub fn zoom_range_override(self, range: Option<RangeInclusive<f32>>) -> Self
pub fn zoom_range_override(self, range: Option<RangeInclusive<f32>>) -> Self
Replace the view-level zoom-range override wholesale.
None clears the override so this view imposes no zoom
clamp of its own (Scene-level constraints still apply).
Tightening rule: the effective clamp is the intersection
with Scene::current_zoom_range() — neither can loosen.
Sourcepub fn zoom_range_override_signal(&self) -> Signal<Option<RangeInclusive<f32>>>
pub fn zoom_range_override_signal(&self) -> Signal<Option<RangeInclusive<f32>>>
Reactive accessor for the view-level zoom-range override. Use this to mutate the override at runtime (e.g. from a toolbar). Mutations take effect on the next gesture.
Sourcepub fn pan_bounds_override(self, bounds: Option<Rect>) -> Self
pub fn pan_bounds_override(self, bounds: Option<Rect>) -> Self
View-level tightening override on pan bounds, in scene
coords. The effective clamp at gesture-time is the rect
intersection with Scene::current_pan_bounds() — view
overrides cannot loosen what the Scene declares. None
(default) means no view-side clamp.
Sourcepub fn pan_bounds_override_signal(&self) -> Signal<Option<Rect>>
pub fn pan_bounds_override_signal(&self) -> Signal<Option<Rect>>
Reactive accessor for the view-level pan-bounds override. Use this to mutate the override at runtime (e.g. dynamically shrinking the navigable area). Mutations take effect on the next gesture.
Sourcepub fn line_height(self, px: f32) -> Self
pub fn line_height(self, px: f32) -> Self
Logical pixels of pan applied per scroll-wheel line notch.
Defaults to 16 px (matches ScrollArea).
Sourcepub fn overscroll_behavior(self, behavior: OverscrollBehavior) -> Self
pub fn overscroll_behavior(self, behavior: OverscrollBehavior) -> Self
Whether a wheel the scene can’t absorb (already clamped at its
pan_bounds) chains to an ancestor scrollable
([OverscrollBehavior::Chain], the default — matches the widget
scrollables) or is contained ([OverscrollBehavior::Contain]). Use
Contain for a tightly-bounded scene embedded in a scroll view that
should never steal the scene’s wheel.
Sourcepub fn with_scroll_bars(self) -> SceneScrollView
pub fn with_scroll_bars(self) -> SceneScrollView
Wrap this view in a SceneScrollView, adding
draggable scroll bars with the widget-tier ScrollArea’s options (mode,
per-axis policy, thickness). The bars track the camera and drive panning;
native wheel / drag panning — and its smoothing — keeps working.
Configure the result with the SceneScrollView builder methods:
let scrollable = SceneView::new(Scene::new())
.with_scroll_bars()
.scroll_bar_mode(ScrollBarMode::Overlay)
.vertical_policy(ScrollBarPolicy::AsNeeded);Source§impl SceneView
impl SceneView
Sourcepub fn scene(&self) -> Ref<'_, Scene>
pub fn scene(&self) -> Ref<'_, Scene>
Read access to the underlying scene, as a borrow guard.
Prefer the cloneable model handle for multi-view
wiring and scene mutation (its methods are &self); this guard is the
single-view escape hatch for ad-hoc reads.
Sourcepub fn scene_mut(&mut self) -> RefMut<'_, Scene>
pub fn scene_mut(&mut self) -> RefMut<'_, Scene>
Mutable access to the underlying scene, as a borrow guard.
Single-view escape hatch. For multi-view, mutate through the shared
SceneModel handle (model) — every
mutator is &self, so a handler holding a clone can drive the scene
directly (no with_widget_mut needed) and all views reconcile:
let model = view.model(); // cheap handle clone
model.add_widget_item(card_data, rect); // every view rebuilds itThe view self-reconciles on every mutation: add_widget_item /
add_item materialise on the next rebuild, remove destroys the
orphaned arena widget and cleans its maps, set_payload rebuilds an
item’s widget, and both the visual tree and the separate AccessKit
tree re-walk (geometry, reparents, and pure-a11y mutations all reach
assistive tech — build() requests an AT re-walk, since a relayout no
longer does so on its own).
Sourcepub fn widget_id_for(&self, id: ItemId) -> Option<WidgetId>
pub fn widget_id_for(&self, id: ItemId) -> Option<WidgetId>
The WidgetId an item was materialised as, if known.
Sourcepub fn pan_x_animation_target(&self) -> Option<f32>
pub fn pan_x_animation_target(&self) -> Option<f32>
In-flight animation target for the X pan signal, or None
if the signal is at rest. Useful for tests that want to
observe a tween before it lands without spinning the
scheduler.
Sourcepub fn pan_y_animation_target(&self) -> Option<f32>
pub fn pan_y_animation_target(&self) -> Option<f32>
In-flight animation target for the Y pan signal.
Sourcepub fn zoom_animation_target(&self) -> Option<f32>
pub fn zoom_animation_target(&self) -> Option<f32>
In-flight animation target for the zoom signal.
Sourcepub fn view_transform(&self) -> Transform2D
pub fn view_transform(&self) -> Transform2D
The composed view transform the render walker has on its
stack while painting this view’s subtree. Includes the
bounds.origin offset captured during the last
place_children call, so this is the exact transform
applied to scene-coord points by the renderer.
Sourcepub fn view_scale(&self) -> f32
pub fn view_scale(&self) -> f32
The view’s uniform zoom — the scale of the view transform’s linear
part, the same number pointer dispatch passes to
ItemShape::contains.
It reaches exactly one thing: a cosmetic (device-pixel) stroke
band, whose width in scene coordinates shrinks as the view zooms in.
Computed as the hypotenuse of the transform’s first column so a pure
rotation reports 1.0.
Sourcepub fn map_to_scene(&self, view_pt: Point) -> Point
pub fn map_to_scene(&self, view_pt: Point) -> Point
Project a point in view space (screen-pixel coords —
the same frame pointer events arrive in) into scene
coordinates. Inverse of map_from_scene.
Returns the scene origin when the view transform is
degenerate (e.g. zoom = 0).
Sourcepub fn map_from_scene(&self, scene_pt: Point) -> Point
pub fn map_from_scene(&self, scene_pt: Point) -> Point
Project a point in scene coords to view space (screen
pixels). Inverse of map_to_scene.
Sourcepub fn map_rect_to_scene(&self, view_rect: Rect) -> Rect
pub fn map_rect_to_scene(&self, view_rect: Rect) -> Rect
Project a rectangle in view space into scene coordinates. Returns the AABB of the four projected corners under rotation. Empty rect when the view transform is degenerate.
Sourcepub fn map_rect_from_scene(&self, scene_rect: Rect) -> Rect
pub fn map_rect_from_scene(&self, scene_rect: Rect) -> Rect
Project a rectangle in scene coords into view space.
Sourcepub fn viewport_in_scene_signal(&self) -> Signal<Rect>
pub fn viewport_in_scene_signal(&self) -> Signal<Rect>
Reactive signal of the visible scene region — the portion of scene space currently inside the SceneView’s viewport. Fires whenever pan / zoom / rotation / bounds_origin / viewport-size changes.
Use to drive a minimap viewport indicator, lazy-load only
the visible scene region, or implement “scroll into view”
guards. The value is the AABB of the viewport rectangle
projected through view_transform.inverse().
Sourcepub fn viewport_size_signal(&self) -> Signal<Size>
pub fn viewport_size_signal(&self) -> Signal<Size>
Reactive signal of the SceneView’s resolved viewport size.
Fires whenever layout_response resolves a new size that
differs from the previous.
Sourcepub fn pan_to(&self, target: Vec2, duration: Duration)
pub fn pan_to(&self, target: Vec2, duration: Duration)
Animate pan to target over duration. Bounded by
Easing::EaseOut. Honours prefers-reduced-motion only
indirectly: the scheduler pauses animation on window-inactive
and the test seam allows snapping. For an explicit snap, call
SceneView::set_pan.
Sourcepub fn set_pan(&self, target: Vec2)
pub fn set_pan(&self, target: Vec2)
Snap pan to target without animation. Gated by the scene’s
PanAxes policy.
Sourcepub fn zoom_to(&self, target: f32, duration: Duration)
pub fn zoom_to(&self, target: f32, duration: Duration)
Animate zoom to target over duration, clamped to
[min_zoom, max_zoom]. No-op when the scene declares
Scene::zoomable(false).
Sourcepub fn set_zoom(&self, target: f32)
pub fn set_zoom(&self, target: f32)
Snap zoom to target without animation, clamped. No-op when
the scene declares zoom disabled.
Sourcepub fn ensure_visible(&self, scene_rect: Rect, margin: f32)
pub fn ensure_visible(&self, scene_rect: Rect, margin: f32)
Pan (without changing zoom) so scene_rect.expand(margin)
fits inside the current visible scene region. If the
expanded target rect already fits, this is a no-op.
Animated, over the view’s pan-animation duration. For an instant jump,
or to pin the target at a fraction of the viewport rather than merely
reveal it, use
ensure_visible_aligned.
§Who calls this
An app scrolling to a search hit or a newly created item calls it
directly. The framework calls it for every
[teksilo_core::event::WidgetEvent::ScrollIntoView]
that reaches the view — which is how a caret inside an embedded editor
moves the camera, since a SceneView clips its children and is
therefore on the reveal walk. (It is not called by focus traversal:
this doc used to claim it was, and nothing in the crate ever did.)
Pan is gated by Scene::pan_axes:
if a scene declares PanAxes::None, this is a no-op; if it
declares a single axis, only that axis pans. Items can’t be
scrolled into view if the policy doesn’t permit panning
toward them.
Sourcepub fn ensure_visible_aligned(
&self,
scene_rect: Rect,
margin: f32,
align: ScrollAlign,
motion: ScrollMotion,
) -> Vec2
pub fn ensure_visible_aligned( &self, scene_rect: Rect, margin: f32, align: ScrollAlign, motion: ScrollMotion, ) -> Vec2
ensure_visible with an explicit alignment and
motion, reporting the shift it applied in scene coordinates.
- [
ScrollAlign::Minimal] reveals the target and does nothing when it is already visible; [ScrollAlign::Fraction] pins its topfof the way down the viewport whether or not it was visible. - [
ScrollMotion::Instant] snaps. That is what a caret chase wants: animating a reveal that re-fires on every keystroke is what produces the screen-bouncing typewriter modes are complained about for.
The returned vector is Vec2::ZERO when nothing moved, and is what the
ScrollIntoView
applied_scroll back-channel carries: the shift the target appears to
make relative to the viewport, stated in the space the caller asked
in. The reveal walk subtracts it from the rectangle before projecting
that rectangle out to the next container, using the transform it read
before dispatching — so a screen-space pan delta there would be wrong
by a factor of the zoom, and under rotation by an angle.
Sourcepub fn rotate_to(&self, target_radians: f32, duration: Duration)
pub fn rotate_to(&self, target_radians: f32, duration: Duration)
Animate rotation to target over duration (radians).
Sourcepub fn set_rotation(&self, target_radians: f32)
pub fn set_rotation(&self, target_radians: f32)
Snap rotation to target without animation.
Sourcepub fn state(&self) -> SceneViewState
pub fn state(&self) -> SceneViewState
Snapshot the current pan / zoom / rotation as a
SceneViewState. Designed for
persistence: store the snapshot in your settings layer on
app exit, restore it via restore_state
on next launch.
The snapshot reflects the current signal values — if a
pan/zoom animation is in flight, the captured values are
the in-flight tween position, not the eventual target.
Apps that want to capture the target should query
pan_x_animation_target /
friends manually.
Sourcepub fn restore_state(&self, state: SceneViewState)
pub fn restore_state(&self, state: SceneViewState)
Restore a previously captured SceneViewState.
Snaps each signal to the saved value (no animation —
pan/zoom/rotation jump to the persisted state immediately).
Zoom is clamped to [min_zoom, max_zoom].
Sourcepub fn viewport_size(&self) -> Size
pub fn viewport_size(&self) -> Size
Latest viewport size observed during layout. Useful for
imperative fit_* calls.
Sourcepub fn scene_content_bounds(&self) -> Option<Rect>
pub fn scene_content_bounds(&self) -> Option<Rect>
Compute the bounding rectangle (in scene coords) that encloses
every item in the scene. Returns None for an empty scene.
Sourcepub fn fit_to_content(&self)
pub fn fit_to_content(&self)
Animate pan + zoom so the scene’s content bounding box fits the current viewport with a small margin. No-op for an empty scene. Resets rotation to 0.
Sourcepub fn fit_to_items(&self, ids: &[ItemId])
pub fn fit_to_items(&self, ids: &[ItemId])
Animate pan + zoom so the union of the given items’ bounds
fits the current viewport. Ids not currently in the scene
are skipped silently. No-op if ids is empty or all ids are
stale. Resets rotation to 0.
Use this for “zoom to selection” / “frame this subset” UX.
Sourcepub fn fit_to_selection(&self)
pub fn fit_to_selection(&self)
Animate pan + zoom so the bounds of the currently selected items fit the viewport. No-op when nothing is selected. Convenience for the common “F to focus selection” hotkey.
Trait Implementations§
Source§impl Widget for SceneView
impl Widget for SceneView
Source§fn accepts_child_hit(&self, child: WidgetId, point: Point) -> bool
fn accepts_child_hit(&self, child: WidgetId, point: Point) -> bool
Reject a heavyweight child for a point a press claimant painted above that child covers, so the arena’s verdict matches the one this view’s own dispatch gives.
point is in scene coordinates: the view is a content_transform node,
so the arena has already mapped the pointer through the inverse view
transform before offering it to children.
Without this, the two pickers answer independently and only the tap can be papered over: press feedback, focus-on-release, the touch hold route (hence touch tooltips and context menus), the cursor and the view’s own drag recognizer all resolve from the arena’s target, so five of the six would stay on the card while the sixth went to the item.
Above that child, not “in the Over band”: the question is asked
per child and answered by comparing whole
PaintKeys — so an
Interleaved claimant vetoes the
cards it is painted over and leaves the ones painted over it alone.
The Over band is above every card, so for it this is the rule it
always was.
A child with no key — anything this view did not place, and the
paint-only nodes, which never reach here because they are
event_pass_through — is treated as sitting at the bottom of the widget
rank, which is the permissive pre-existing answer.
The rule is claims_press, not “is painted”: a
decorative halo drawn over an embedded note never vetoes, so clicking it
leaves focus in the note and leaves explore-by-touch announcing the
note — which is the behaviour the crate’s per-item AT tree exists to
protect.
§The order of the two questions is the cost of the feature
The claimant is resolved first and the child’s key looked up only against an actual answer. Both halves of that matter, and getting either backwards has already cost real time here:
- the claimant query is memoised for the whole hit walk, so the arena’s
once-per-child call costs one snapshot scan for the walk rather than
one per child — which is only true because the memoised question is
floor-free (see
press_claimant_aboveinview.rs); SceneView::child_paint_keyis aRefCellborrow and aHashMapprobe. Passed as an argument it is evaluated before the claimant check can decline it, so a scene with no press claimant at all — the case theover_claimantsshort-circuit exists to keep free — still paid for one on every child it was asked about. Asked in this order it pays for none.
The arena’s walk stops at the first child it can descend into, so the per-child cost only multiplies when the veto is rejecting — which is exactly the scene the feature is for, and why the claimant query has to answer from a memo rather than a scan.
Source§fn culls_children(&self) -> bool
fn culls_children(&self) -> bool
A scene holds far more than it shows, and the half it does not show should not be reachable: a card 90 000 px away is a Tab stop between two visible ones and a node assistive tech is offered. Collapsing its size to zero answers neither — a zero-size widget is still alive.
So place_children is handed every card, parked ones included, and
reads back WidgetPlacement::dormant. See place_children_impl for
the two regions that decide it, and SceneView::retention_margin.
Source§fn accessibility_children(&self) -> Option<Vec<WidgetId>>
fn accessibility_children(&self) -> Option<Vec<WidgetId>>
The cards this view offers assistive technology — a subset of its arena children, in the same order.
Being alive and being enumerated are separate questions here (see
place_children_impl), and this is the hook that keeps the second one
answerable at all. The framework walker uses this list for BOTH the
child push and the recursion, so a card left out of it is neither named
by a parent nor emitted as a node: no orphan, no dangling child,
nothing downstream to clean up. Suppressing through the redirect hook
instead would leave the node emitted and unreferenced, which the
consumer rejects.
None — the framework’s “use the arena’s children” — until the first
place_children, because before that nothing has been decided.
A card in this state is still a Tab stop. That is the honest reading of
the two knobs it sits between: it is alive because
retention_margin said to keep it warm,
and unlisted because
a11y_off_screen_mode said not to
offer it. Landing focus on it pins it, and the pass that lands the focus
publishes it.
Source§fn build(&mut self, ctx: &mut BuildContext<'_>) -> Vec<WidgetId>
fn build(&mut self, ctx: &mut BuildContext<'_>) -> Vec<WidgetId>
BindingLevel::Rebuild binding, rebuild_single_widget, or a density
switch. A theme or locale switch does not rebuild: set_theme and
set_locale mark layout + paint dirty and leave the built subtree
standing, so anything derived from the theme or the locale must be read
per pass or bound to a signal rather than captured here.
Takes &mut self — store child IDs, signal handles, any state needed later.
Returns the list of root child IDs (empty for leaf widgets).Source§fn layout_response(
&self,
proposal: SizeProposal,
ctx: &LayoutContext<'_>,
) -> LayoutResponse
fn layout_response( &self, proposal: SizeProposal, ctx: &LayoutContext<'_>, ) -> LayoutResponse
LayoutResponse]). Read moreSource§fn place_children(
&self,
bounds: Rect,
proposal: SizeProposal,
children: &mut [WidgetPlacement],
ctx: &LayoutContext<'_>,
)
fn place_children( &self, bounds: Rect, proposal: SizeProposal, children: &mut [WidgetPlacement], ctx: &LayoutContext<'_>, )
Source§fn paint(&self, bounds: Rect, canvas: &mut Canvas, ctx: &PaintContext<'_>)
fn paint(&self, bounds: Rect, canvas: &mut Canvas, ctx: &PaintContext<'_>)
Source§fn wants_post_paint(&self) -> bool
fn wants_post_paint(&self) -> bool
post_paint
hook to fire each frame. Returning false (the default) saves a
virtual call per widget per frame for the vast majority of widgets
that don’t draw a foreground over their children. Read moreSource§fn post_paint(&self, bounds: Rect, canvas: &mut Canvas, ctx: &PaintContext<'_>)
fn post_paint(&self, bounds: Rect, canvas: &mut Canvas, ctx: &PaintContext<'_>)
Source§fn clips_children(&self) -> bool
fn clips_children(&self) -> bool
Source§fn preserves_children_on_rebuild(&self) -> bool
fn preserves_children_on_rebuild(&self) -> bool
rebuild_single_widget treats this widget’s existing children
when re-running its build(). Read moreSource§fn wants_descendant_redirects(&self) -> bool
fn wants_descendant_redirects(&self) -> bool
a11y_redirect_descendant
hook for every descendant during AT tree emission, not
just its direct arena children. Read moreSource§fn a11y_redirect_descendant(
&self,
self_id: WidgetId,
descendant: WidgetId,
) -> Option<NodeId>
fn a11y_redirect_descendant( &self, self_id: WidgetId, descendant: WidgetId, ) -> Option<NodeId>
Source§fn accessibility(&self, builder: &mut AccessNodeBuilder)
fn accessibility(&self, builder: &mut AccessNodeBuilder)
Source§fn as_any(&self) -> Option<&dyn Any>
fn as_any(&self) -> Option<&dyn Any>
None; concrete
widgets override with Some(self) when they want to expose
their concrete type to test-level introspection or reflection.
The trait already bounds on std::any::Any so concrete types
satisfy the 'static requirement.Source§fn as_any_mut(&mut self) -> Option<&mut dyn Any>
fn as_any_mut(&mut self) -> Option<&mut dyn Any>
as_any. Default
returns None; widgets that want to expose mutable state to
tests (e.g. so a test can mutate a Scene inside a
SceneView post-layout) override with Some(self). Should
follow the same opt-in pattern as as_any: only widgets
that opt into & introspection should opt into &mut.§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
"teksilo_widgets::button::Button"). The default implementation
resolves at the impl site via std::any::type_name::<Self>(),
so calls through &dyn Widget correctly dispatch to the
monomorphized fn for the concrete type — getting the
concrete name through the vtable without per-impl boilerplate. Read more§fn cacheable_layout(&self) -> bool
fn cacheable_layout(&self) -> bool
layout_response may be
memoized by the per-pass layout cache. Defaults to true. Read more§fn wants_after_paint(&self) -> bool
fn wants_after_paint(&self) -> bool
after_paint
hook to fire each frame. Returning false (the default) saves
a virtual call per widget per frame for the vast majority of
widgets that don’t aggregate descendant geometry. Read more§fn after_paint(&self, _view: &WidgetTreeView<'_>, _ctx: &PaintContext<'_>)
fn after_paint(&self, _view: &WidgetTreeView<'_>, _ctx: &PaintContext<'_>)
TitleBar aggregates its drag region and control-button
rects into a single HitRegions payload for the Windows
backend’s WM_NCHITTEST. Read more§fn accessible_title_hint(&self) -> Option<String>
fn accessible_title_hint(&self) -> Option<String>
§fn accessible_title_node(&self) -> Option<WidgetId>
fn accessible_title_node(&self) -> Option<WidgetId>
§fn initial_focus_hint(&self) -> Option<WidgetId>
fn initial_focus_hint(&self) -> Option<WidgetId>
§fn accessibility_proxy(&self) -> Option<WidgetId>
fn accessibility_proxy(&self) -> Option<WidgetId>
§fn focus_reveal_rect(&self, _bounds: Rect) -> Option<Rect>
fn focus_reveal_rect(&self, _bounds: Rect) -> Option<Rect>
None (the default) reveals the widget’s whole
bounds — correct for most controls. Read more§fn hit_shape(&self, _local_point: Point, _bounds: Rect) -> bool
fn hit_shape(&self, _local_point: Point, _bounds: Rect) -> bool
false for a point that is inside
the bounding box makes the widget transparent to the click there,
so it falls through to whatever sibling is painted underneath
(the same machinery as a fully pass-through node, but shape-aware). Read more§fn hit_outset(&self, _kind: PointerKind, _tokens: &InputTokens) -> EdgeInsets
fn hit_outset(&self, _kind: PointerKind, _tokens: &InputTokens) -> EdgeInsets
§fn hit_slop(&self, _kind: PointerKind, _tokens: &InputTokens) -> Option<HitSlop>
fn hit_slop(&self, _kind: PointerKind, _tokens: &InputTokens) -> Option<HitSlop>
§fn hit_distance(&self, local_point: Point, bounds: Rect) -> Option<f32>
fn hit_distance(&self, local_point: Point, bounds: Rect) -> Option<f32>
§fn target_regions(&self, _bounds: Rect) -> Vec<TargetRegion>
fn target_regions(&self, _bounds: Rect) -> Vec<TargetRegion>
§fn tooltip_has_content(&self) -> bool
fn tooltip_has_content(&self) -> bool
§fn declare_shortcuts(&self) -> Vec<Shortcut>
fn declare_shortcuts(&self) -> Vec<Shortcut>
build()) and at certain lazy
boundaries (e.g. Switcher walks declarations on its
not-yet-mounted Pending slots), so settings UIs and the
ShortcutRegistry see the keystrokes the moment the owning
container mounts — even if build() hasn’t run. Read more§fn take_handler_set(&mut self) -> Option<HandlerSet>
fn take_handler_set(&mut self) -> Option<HandlerSet>
WidgetWithHandlers wrapper.
Called during arena insertion to transfer handlers to the WidgetNode.
Default: returns None (no attached handlers).Auto Trait Implementations§
impl !Freeze for SceneView
impl !RefUnwindSafe for SceneView
impl !Send for SceneView
impl !Sync for SceneView
impl !UnwindSafe for SceneView
impl Unpin for SceneView
impl UnsafeUnpin for SceneView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<W> IntoTeksiChild for Wwhere
W: Widget + 'static,
impl<W> IntoTeksiChild for Wwhere
W: Widget + 'static,
fn into_pending(self) -> PendingChild
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<W> WidgetBuilder for Wwhere
W: Widget + 'static,
impl<W> WidgetBuilder for Wwhere
W: Widget + 'static,
fn on_tap( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_double_tap( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_triple_tap( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_long_press( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
on_tap. Default is [ButtonMask::PRIMARY]. Read moreon_double_tap. Default [ButtonMask::PRIMARY]. Read moreon_triple_tap. Default [ButtonMask::PRIMARY]. Read moreon_long_press. Default [ButtonMask::PRIMARY]. Read morefn on_drag( self, f: impl FnMut(DragPhase, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_swipe( self, f: impl FnMut(SwipeDirection, f32, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_pinch( self, f: impl FnMut(PinchPhase, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_focus( self, f: impl FnMut(bool, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_key( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
§fn on_key_preview(
self,
f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static,
) -> WidgetWithHandlers<Self>
fn on_key_preview( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
HandlerSet::on_key_preview].fn on_pointer_event( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
fn on_hover( self, f: impl FnMut(bool, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_scroll( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
fn on_access_action( self, f: impl FnMut(Action, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
fn focusable(self, focusable: bool) -> WidgetWithHandlers<Self>
fn tab_index(self, index: i32) -> WidgetWithHandlers<Self>
fn cursor(self, cursor: CursorIcon) -> WidgetWithHandlers<Self>
fn clips_children_on(self, clips: bool) -> WidgetWithHandlers<Self>
§fn ime_input(self, ctx: ImeContext) -> WidgetWithHandlers<Self>
fn ime_input(self, ctx: ImeContext) -> WidgetWithHandlers<Self>
ctx’s purpose) while it is focused. See [crate::ime].§fn event_pass_through(self, pass_through: bool) -> WidgetWithHandlers<Self>
fn event_pass_through(self, pass_through: bool) -> WidgetWithHandlers<Self>
HandlerSet::event_pass_through].§fn gesture_dead_zone(self, dead_zone: bool) -> WidgetWithHandlers<Self>
fn gesture_dead_zone(self, dead_zone: bool) -> WidgetWithHandlers<Self>
HandlerSet::gesture_dead_zone].§fn long_press_role(self, role: LongPressRole) -> WidgetWithHandlers<Self>
fn long_press_role(self, role: LongPressRole) -> WidgetWithHandlers<Self>
HandlerSet::long_press_role].§fn touch_action(self, action: TouchAction) -> WidgetWithHandlers<Self>
fn touch_action(self, action: TouchAction) -> WidgetWithHandlers<Self>
HandlerSet::touch_action].§fn scroll_container(self, axes: PanAxes) -> WidgetWithHandlers<Self>
fn scroll_container(self, axes: PanAxes) -> WidgetWithHandlers<Self>
axes, kinetic, direct pointers
only. See [HandlerSet::scroll_container].§fn pan_claim(self, claim: PanClaim) -> WidgetWithHandlers<Self>
fn pan_claim(self, claim: PanClaim) -> WidgetWithHandlers<Self>
PanClaim]. See
[HandlerSet::pan_claim].§fn overscroll_behavior(
self,
behavior: OverscrollBehavior,
) -> WidgetWithHandlers<Self>
fn overscroll_behavior( self, behavior: OverscrollBehavior, ) -> WidgetWithHandlers<Self>
HandlerSet::overscroll_behavior].§fn drag_activation(self, activation: DragActivation) -> WidgetWithHandlers<Self>
fn drag_activation(self, activation: DragActivation) -> WidgetWithHandlers<Self>
HandlerSet::drag_activation].§fn multi_contact(self, policy: MultiContact) -> WidgetWithHandlers<Self>
fn multi_contact(self, policy: MultiContact) -> WidgetWithHandlers<Self>
MultiContact::First] — the second finger on a single-contact control
is terminated there rather than reaching an ancestor.§fn keyboard_capture(self, capture: bool) -> WidgetWithHandlers<Self>
fn keyboard_capture(self, capture: bool) -> WidgetWithHandlers<Self>
KeyDowns bypass shortcut resolution.
See [HandlerSet::keyboard_capture].§fn hit_transparent(self, transparent: bool) -> WidgetWithHandlers<Self>
fn hit_transparent(self, transparent: bool) -> WidgetWithHandlers<Self>
HandlerSet::hit_transparent].§fn hit_slop(self, slop: HitSlop) -> WidgetWithHandlers<Self>
fn hit_slop(self, slop: HitSlop) -> WidgetWithHandlers<Self>
HandlerSet::hit_slop].§fn no_hit_slop(self) -> WidgetWithHandlers<Self>
fn no_hit_slop(self) -> WidgetWithHandlers<Self>
Widget::hit_outset. See [HandlerSet::no_hit_slop].HandlerSet::context_menu] for the full contract.§fn focus_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
fn focus_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
Signal<bool> the framework writes when a strict
descendant has focus. See [HandlerSet::focus_within].§fn hover_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
fn hover_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
Signal<bool> the framework writes when a strict
descendant is hovered. See [HandlerSet::hover_within].§fn visible_when(self, state: impl Into<Prop<bool>>) -> WidgetWithHandlers<Self>
fn visible_when(self, state: impl Into<Prop<bool>>) -> WidgetWithHandlers<Self>
bool / Signal<bool> / Prop<bool>) as
a builder property, so teksu! can write visible_when: sig. Equivalent
to ctx.visible_when(id, ..). See [HandlerSet::visible_when].fn on_drag_hover( self, f: impl FnMut(&DragPayload, Point, &mut EventContext<'_>) -> DropFeedback + 'static, ) -> WidgetWithHandlers<Self>
fn on_drag_leave( self, f: impl FnMut(&mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_drag_tick( self, f: impl FnMut(Point, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
§fn on_pointer_cancel(
self,
f: impl FnMut(&PointerInfo, CancelReason, &mut EventContext<'_>) + 'static,
) -> WidgetWithHandlers<Self>
fn on_pointer_cancel( self, f: impl FnMut(&PointerInfo, CancelReason, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
HandlerSet::on_pointer_cancel].fn on_drop( self, f: impl FnMut(DragPayload, Point, &mut EventContext<'_>) -> bool + 'static, ) -> WidgetWithHandlers<Self>
§fn on_drag_ended(
self,
f: impl FnMut(DropOutcome, &mut EventContext<'_>) + 'static,
) -> WidgetWithHandlers<Self>
fn on_drag_ended( self, f: impl FnMut(DropOutcome, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
HandlerSet::on_drag_ended].