pub struct NodeSpec {Show 16 fields
pub layout: LayoutSpec,
pub style: VisualStyle,
pub hoverable: bool,
pub animate: bool,
pub accent: bool,
pub window: Option<WindowRole>,
pub transition: Option<Transition>,
pub slide: bool,
pub focusable: bool,
pub initial_focus: bool,
pub disabled: bool,
pub cursor: Option<CursorShape>,
pub events: Option<Box<EventSpec>>,
pub anim: Option<Box<AnimSpec>>,
pub access: Option<Box<AccessSpec>>,
pub interact: Option<Box<InteractSpec>>,
}Expand description
Everything one node declares. This, not any Rust trait, is the contract
every frontend (Rust builders, Lua, JSX, C) lowers into. Start from
NodeSpec::row, NodeSpec::column or NodeSpec::table and
chain builders; see the module docs for an example.
Fields§
§layout: LayoutSpec§style: VisualStyle§hoverable: boolTrack pointer hover for this node (Ui::is_hovered) without making
it clickable — tooltips on passive badges. Nodes with on_click /
on_key / window are always hover-tracked; clicks on a merely
hoverable node emit nothing.
animate: boolAsk the driver for another frame after this one, every frame this
node is declared (animate). What a fragment reading time
needs; opt-in, because it takes the loop off input-driven.
accent: boolPaint this node’s background in the theme’s accent: the OS’s where the host reported one, the app’s where it pinned one, kui’s blue otherwise. A view says that this node is the accented one and the palette says which colour that is. The stock button also repaints its hover, pressed shade and label from the same accent.
window: Option<WindowRole>Window-chrome role (drag handle / window button). A chrome node’s
interactions become WindowCommands for the frame driver instead of
UiEvents; on_click is ignored on such nodes.
transition: Option<Transition>Eases this node’s sizing amounts, colors and radius toward what the
view declares instead of snapping (see crate::anim). Keyed by
node identity, so the node needs a stable key across frames.
slide: boolWith transition: also ease this node’s laid-out position, moving
its whole subtree — reordered siblings slide into their new slots.
Opt-in because a node whose position follows an already-easing
sibling (a split’s second half) would lag twice.
focusable: boolReachable by Tab, and focused by a click or an assistive-technology
request, without a click payload or a control role — a list row
that opens on Enter, a card. Controls (editors, key sinks,
on_click boxes, the control roles) are focusable already.
initial_focus: boolWhere focus lands when the modal scope containing this node is
entered: the first node in the modal’s Tab ring declaring it,
instead of simply the ring’s first — a destructive confirm opening
on its Cancel rather than on whichever control is declared first.
Read on entry only, so a Tab press afterwards stands; a node the
ring skips (disabled, decoration, not focusable) is not a
candidate, and with no candidate the entry is the ring’s first
node as before.
disabled: boolInert: keeps its hit region (so a tooltip can say why) and loses everything else — no click, drag or key sink, no hover / pressed / focus background, no place in the Tab ring; the access tree reports it disabled.
cursor: Option<CursorShape>The pointer shape over this node (see crate::cursor). Unset,
the pointer is the I-beam over an editor or a selection scope and
the plain arrow over everything else — a clickable or draggable
node included — so a hand over a button, a grab over a handle
(grabbing while its drag runs), a splitter’s resize arrows and a
disabled control’s notAllowed are all the view’s to declare. The
stock button declares Pointer itself.
events: Option<Box<EventSpec>>See EventSpec. None when the node declares none of it.
anim: Option<Box<AnimSpec>>See AnimSpec. None when the node declares none of it.
access: Option<Box<AccessSpec>>See AccessSpec. None when the node declares none of it.
interact: Option<Box<InteractSpec>>See InteractSpec. None when the node declares none of it.
Implementations§
Source§impl NodeSpec
impl NodeSpec
Sourcepub fn events(&self) -> &EventSpec
pub fn events(&self) -> &EventSpec
Event payloads this node declares, empty if it declares none.
Sourcepub fn events_mut(&mut self) -> &mut EventSpec
pub fn events_mut(&mut self) -> &mut EventSpec
Allocates the group on first write.
Sourcepub fn access(&self) -> &AccessSpec
pub fn access(&self) -> &AccessSpec
Declared accessibility properties, empty if this node declares none.
Sourcepub fn access_mut(&mut self) -> &mut AccessSpec
pub fn access_mut(&mut self) -> &mut AccessSpec
Allocates the group on first write.
Sourcepub fn interact(&self) -> &InteractSpec
pub fn interact(&self) -> &InteractSpec
Hover / pressed / focus styling, empty if this node declares none.
Sourcepub fn interact_mut(&mut self) -> &mut InteractSpec
pub fn interact_mut(&mut self) -> &mut InteractSpec
Allocates the group on first write.
Sourcepub fn hover_tracked(&self) -> bool
pub fn hover_tracked(&self) -> bool
Whether the core registers a hit region for this node (any of the
interaction props, or an explicit hoverable).
Sourcepub fn hover_group_id(name: &str) -> u64
pub fn hover_group_id(name: &str) -> u64
The group id hover_group(name) assigns — reproducible from any
binding (the same FNV mix as Key).
Sourcepub fn table() -> Self
pub fn table() -> Self
A table: a column whose rows’ children line up in columns. Its
in-flow Row children are the rows and each row’s in-flow children
its cells; the nth cell of every row is column n, and a column is
as wide as its widest cell, so a label column sits at its longest
label with no width picked by hand.
A cell’s width says how its column sizes: Fit (the default) and
Fixed are content the column’s fit width is the max of, Grow
makes the whole column grow with the table, and a column’s
min_width / max_width are the strictest its cells declared.
Give the rows width: grow for the columns to grow into; a Fit
row sits at the columns’ fit width. Rows keep their own gap,
padding, background, click and hover, and never wrap. A bare text
or image straight inside a row is a cell too. A text, a column or a
table straight under the table is a child with its own width and no
cells. Everything else is a column’s: gap is the space between
rows, scroll_y scrolls them.
use kui_core::{NodeSpec, Sizing};
let table = NodeSpec::table().gap(4.0).rules(kui_core::Color::hex(0x80808080));
let row = NodeSpec::row().width(Sizing::GROW).gap(12.0);
assert!(table.layout.is_table() && !row.layout.is_table());Sourcepub fn size(self, w: impl Into<Sizing>, h: impl Into<Sizing>) -> Self
pub fn size(self, w: impl Into<Sizing>, h: impl Into<Sizing>) -> Self
Both axes at once: .size(20.0, 20.0) for a fixed box,
.size(Sizing::GROW, 24.0) for a strip.
Sourcepub fn grow_width(self) -> Self
pub fn grow_width(self) -> Self
An equal share of the leftover width: .width(Sizing::GROW).
Sourcepub fn grow_height(self) -> Self
pub fn grow_height(self) -> Self
An equal share of the leftover height: .height(Sizing::GROW).
Sourcepub fn min_width(self, v: impl Into<Bound>) -> Self
pub fn min_width(self, v: impl Into<Bound>) -> Self
A number of px, Min::FIT for the node’s own fit width, or a
Bound::Calc.
Sourcepub fn max_width(self, v: impl Into<Bound>) -> Self
pub fn max_width(self, v: impl Into<Bound>) -> Self
A number of px, or a Bound::Calc; a max has no fit size, so
Bound::Fit is no clamp. A px ceiling below zero, or NaN, is
a ceiling of 0 (px_ceiling).
Sourcepub fn min_height(self, v: impl Into<Bound>) -> Self
pub fn min_height(self, v: impl Into<Bound>) -> Self
A number of px, Min::FIT for the node’s own fit height, or a
Bound::Calc.
Sourcepub fn with_bounds(
self,
min_w: Option<Bound>,
max_w: Option<Bound>,
min_h: Option<Bound>,
max_h: Option<Bound>,
) -> Self
pub fn with_bounds( self, min_w: Option<Bound>, max_w: Option<Bound>, min_h: Option<Bound>, max_h: Option<Bound>, ) -> Self
The four clamps where each is given, a transport’s shape (C’s
*_size fields): None leaves that clamp as it is.
Sourcepub fn clip(self) -> Self
pub fn clip(self) -> Self
Clip children to this node’s rect without scrolling. A radius on
the same node rounds the clip, so children stay inside its corners
(see display::Clip).
Sourcepub fn anchor(self) -> Self
pub fn anchor(self) -> Self
Scroll anchoring on this container (see LayoutSpec::anchor):
the first child in view stays where it is on screen when the
content before it changes size. Needs scroll_y on a column or
scroll_x on a row.
Sourcepub fn float(self, cfg: FloatConfig) -> Self
pub fn float(self, cfg: FloatConfig) -> Self
Take this node out of flex flow; see FloatConfig.
Sourcepub fn overflow_bits(self, bits: u32) -> Self
pub fn overflow_bits(self, bits: u32) -> Self
Apply the overflow bits (OVERFLOW_CLIP and friends). What a bit
means is decided here: a binding ORs together whatever its own
surface spells (clip, scrollX, overflow) and hands the number
over, rather than each one re-deciding that scrolling clips too.
Sourcepub fn tooltip(self, hint: &str) -> Self
pub fn tooltip(self, hint: &str) -> Self
A tooltip: the node tracks hover, hint is its accessible
description, and the core floats the hint below it while it is
hovered. On a box or a fragment the float is the node’s last child;
on a leaf — an image, an editor, a cells grid, a line, a polygon, a
path — which holds no children, it floats beside the leaf, anchored
to it (FloatAnchor::Node), and lands below the leaf’s box all
the same (backlog RG113).
Sourcepub fn apply_tooltip(self, hint: &str) -> Self
pub fn apply_tooltip(self, hint: &str) -> Self
The spec half of the tooltip prop: the hint is hover-gated, so the
node tracks hover, and it is what assistive technology should say, so
it is the accessible description too — and nothing floats. For a
caller that floats the hint itself: crate::schema::PropsOut::apply_tooltip
for the parsers, kui_close for C, a widget that draws its own. A
Rust view wants Self::tooltip, which is all three.
Sourcepub fn max_height(self, v: impl Into<Bound>) -> Self
pub fn max_height(self, v: impl Into<Bound>) -> Self
A number of px, or a Bound::Calc; Bound::Fit is no clamp.
A px ceiling below zero, or NaN, is a ceiling of 0.
Sourcepub fn pad_xy(self, x: f32, y: f32) -> Self
pub fn pad_xy(self, x: f32, y: f32) -> Self
Padding x on the left and right, y on the top and bottom.
Sourcepub fn wrap(self) -> Self
pub fn wrap(self) -> Self
Wrap overflowing children onto more lines; see LayoutSpec::wrap.
Sourcepub fn main_align(self, a: Align) -> Self
pub fn main_align(self, a: Align) -> Self
Where children sit along the main axis; the spreads are allowed.
Sourcepub fn cross_align(self, a: Align) -> Self
pub fn cross_align(self, a: Align) -> Self
Where children sit across the main axis; Baseline on a row.
Sourcepub fn aspect_ratio(self, ratio: f32) -> Self
pub fn aspect_ratio(self, ratio: f32) -> Self
Width over height (CSS’s aspect-ratio): see
LayoutSpec::aspect. 16.0 / 9.0 for a video, 1.0 for a
square. A ratio that is not positive and finite clears it.
Sourcepub fn radius(self, r: f32) -> Self
pub fn radius(self, r: f32) -> Self
Rounds all four corners by r. On a node that also clips or
scrolls it rounds the clip too, so its children are cut to the same
corners rather than poking square out of them.
Sourcepub fn radii(self, tl: f32, tr: f32, br: f32, bl: f32) -> Self
pub fn radii(self, tl: f32, tr: f32, br: f32, bl: f32) -> Self
Per-corner radii, clockwise from the top-left.
pub fn radius_tl(self, r: f32) -> Self
pub fn radius_tr(self, r: f32) -> Self
pub fn radius_br(self, r: f32) -> Self
pub fn radius_bl(self, r: f32) -> Self
Sourcepub fn radius_top(self, r: f32) -> Self
pub fn radius_top(self, r: f32) -> Self
Rounds the two top corners (tabs, headers).
Sourcepub fn radius_bottom(self, r: f32) -> Self
pub fn radius_bottom(self, r: f32) -> Self
Rounds the two bottom corners.
Sourcepub fn pixel_snap(self) -> Self
pub fn pixel_snap(self) -> Self
Paints this node’s background, border, shadow and fragment on whole pixels
(see VisualStyle::pixel_snap).
Sourcepub fn opacity(self, o: f32) -> Self
pub fn opacity(self, o: f32) -> Self
Fades this node and everything under it (see VisualStyle::opacity);
clamped to 0..=1.
Sourcepub fn shadow(self, shadow: Shadow) -> Self
pub fn shadow(self, shadow: Shadow) -> Self
The whole drop shadow at once: color, offset, blur, spread.
Sourcepub fn shadow_color(self, c: Color) -> Self
pub fn shadow_color(self, c: Color) -> Self
The shadow’s color — on its own, a hard shadow exactly behind the node. Nothing else about a shadow draws without it.
pub fn shadow_blur(self, blur: f32) -> Self
pub fn shadow_offset(self, dx: f32, dy: f32) -> Self
pub fn shadow_x(self, dx: f32) -> Self
pub fn shadow_y(self, dy: f32) -> Self
pub fn shadow_spread(self, spread: f32) -> Self
Sourcepub fn hoverable(self) -> Self
pub fn hoverable(self) -> Self
Hover-track this node without making it clickable; see the
hoverable field.
Sourcepub fn animate(self) -> Self
pub fn animate(self) -> Self
Ask for another frame after this one, for as long as this node is
declared. See the animate prop.
Sourcepub fn accent(self) -> Self
pub fn accent(self) -> Self
Background from the OS accent colour where the host knows it; see the field.
Sourcepub fn on_click(self, payload: impl Into<Value>) -> Self
pub fn on_click(self, payload: impl Into<Value>) -> Self
Makes this node clickable: a click emits payload as a
UiEvent, and the node joins the Tab ring
and reads as a button to assistive technology.
Sourcepub fn drop_bg(self, c: Color) -> Self
pub fn drop_bg(self, c: Color) -> Self
Background while dragged files are over this node (see the
drop_bg field).
Sourcepub fn gradient(self, gradient: Gradient) -> Self
pub fn gradient(self, gradient: Gradient) -> Self
Paints gradient over this node’s bg, under its border and
its children (see the gradient field).
Sourcepub fn backdrop_blur(self, radius: f32) -> Self
pub fn backdrop_blur(self, radius: f32) -> Self
Blurs what was drawn beneath this node, inside its rounded rect,
by radius logical px (see the backdrop_blur field). A
translucent bg over it makes frosted glass:
let bar = NodeSpec::row().backdrop_blur(16.0).bg(Color::hex(0xffffff40));
assert_eq!(bar.interact().backdrop_blur, 16.0);Sourcepub fn rule_width(self, w: f32) -> Self
pub fn rule_width(self, w: f32) -> Self
The rules’ width in logical px; 1 when unset (see rules).
Sourcepub fn selectable(self) -> Self
pub fn selectable(self) -> Self
Makes this node a selection scope (see the selectable field):
the text inside it becomes one selectable run.
Sourcepub fn focus_region(self) -> Self
pub fn focus_region(self) -> Self
Makes this node’s subtree a focus region (see the focus_region
field): a Tab ring of its own, entered on purpose.
Sourcepub fn overscroll(self, o: Overscroll) -> Self
pub fn overscroll(self, o: Overscroll) -> Self
Whether a scroll gesture starting over this scroller at its limit
goes on to the one around it (see Overscroll):
Overscroll::Contain keeps it here.
Sourcepub fn scrollbar(self, mode: ScrollbarMode) -> Self
pub fn scrollbar(self, mode: ScrollbarMode) -> Self
When this node’s scrollbars are drawn (see ScrollbarMode).
Scrolling itself is unchanged whatever the mode.
Sourcepub fn scrollbar_width(self, w: f32) -> Self
pub fn scrollbar_width(self, w: f32) -> Self
The thumb’s width at rest, logical px (see Scrollbar::width).
Sourcepub fn scrollbar_color(self, c: Color) -> Self
pub fn scrollbar_color(self, c: Color) -> Self
The thumb’s colour at rest (see Scrollbar::color).
Sourcepub fn scrollbar_active_color(self, c: Color) -> Self
pub fn scrollbar_active_color(self, c: Color) -> Self
The thumb’s colour under the pointer or dragged (see
Scrollbar::active_color).
Sourcepub fn pressed_bg(self, c: Color) -> Self
pub fn pressed_bg(self, c: Color) -> Self
Background while pressed (see the pressed_bg field).
Sourcepub fn focus_bg(self, c: Color) -> Self
pub fn focus_bg(self, c: Color) -> Self
Background while keyboard-visibly focused (see the focus_bg
field); replaces the default focus ring.
Sourcepub fn on_focus(self, tag: impl Into<Value>) -> Self
pub fn on_focus(self, tag: impl Into<Value>) -> Self
Hears focus entering and leaving this subtree (see the on_focus
field).
Sourcepub fn keep_focus(self) -> Self
pub fn keep_focus(self) -> Self
A press here leaves keyboard focus where it was (see the
keep_focus field).
Sourcepub fn initial_focus(self) -> Self
pub fn initial_focus(self) -> Self
Makes this node the modal scope’s entry focus (see the
initial_focus field).
Sourcepub fn modal(self, tag: impl Into<Value>) -> Self
pub fn modal(self, tag: impl Into<Value>) -> Self
Makes this node the frame’s modal surface (see the modal field).
Sourcepub fn hover_group(self, name: &str) -> Self
pub fn hover_group(self, name: &str) -> Self
Joins the hover group name (see the hover_group field).
Sourcepub fn on_hover(self, tag: impl Into<Value>) -> Self
pub fn on_hover(self, tag: impl Into<Value>) -> Self
Emits enter/leave events for this node (see the on_hover field).
Pass a tag the handler can match on; Value::Null if the node key
is identification enough.
Sourcepub fn on_drop(self, tag: impl Into<Value>) -> Self
pub fn on_drop(self, tag: impl Into<Value>) -> Self
Makes this node a drop zone for files dragged in from the OS (see
the on_drop field).
Sourcepub fn click_sound(self, sound: SoundId) -> Self
pub fn click_sound(self, sound: SoundId) -> Self
Plays a registered sound when this node is clicked (see the
click_sound field).
Sourcepub fn hover_sound(self, sound: SoundId) -> Self
pub fn hover_sound(self, sound: SoundId) -> Self
Plays a registered sound when the pointer enters this node (see the
hover_sound field).
Sourcepub fn on_drag(self, tag: impl Into<Value>) -> Self
pub fn on_drag(self, tag: impl Into<Value>) -> Self
Makes this node draggable (see the on_drag field). Pass a tag the
handler can match on; Value::Null if the node key is enough.
Sourcepub fn on_layout(self, tag: impl Into<Value>) -> Self
pub fn on_layout(self, tag: impl Into<Value>) -> Self
Reports this node’s laid-out rect as an event whenever it changes
(see the on_layout field). Pass a tag the handler can match on;
Value::Null if the node key is identification enough.
Sourcepub fn role(self, role: Role) -> Self
pub fn role(self, role: Role) -> Self
What this node is to assistive technology (see the role field).
Sourcepub fn label(self, label: impl Into<Label>) -> Self
pub fn label(self, label: impl Into<Label>) -> Self
The accessible name (see the label field). Takes an Arc<str>
as well as a &str, so a view can keep one and hand it out every
frame without allocating.
Sourcepub fn description(self, description: impl Into<Label>) -> Self
pub fn description(self, description: impl Into<Label>) -> Self
The accessible description (see the description field).
Sourcepub fn mixed(self, mixed: bool) -> Self
pub fn mixed(self, mixed: bool) -> Self
A checkbox that is neither on nor off (see the mixed field).
Sourcepub fn selected(self, selected: bool) -> Self
pub fn selected(self, selected: bool) -> Self
The current one of a set (see the selected field).
pub fn value_min(self, v: f32) -> Self
pub fn value_max(self, v: f32) -> Self
Sourcepub fn value_step(self, v: f32) -> Self
pub fn value_step(self, v: f32) -> Self
How far one arrow key moves a slider (see the value_step field).
A step that is not positive and finite clears it.
Sourcepub fn on_change(self, tag: impl Into<Value>) -> Self
pub fn on_change(self, tag: impl Into<Value>) -> Self
Asks the core for a slider’s changes (see the on_change field).
Sourcepub fn value_text(self, text: impl Into<Label>) -> Self
pub fn value_text(self, text: impl Into<Label>) -> Self
What a slider’s position reads as (see the value_text field).
Sourcepub fn caret(self, offset: u32) -> Self
pub fn caret(self, offset: u32) -> Self
On a Role::Line of a custom editor: the caret’s byte offset into
this line’s text (see the caret field).
Sourcepub fn selection_anchor(self, offset: u32) -> Self
pub fn selection_anchor(self, offset: u32) -> Self
On a Role::Line of a custom editor: the byte offset where the
selection’s other end sits (see the selection_anchor field).
Sourcepub fn caret_solid(self) -> Self
pub fn caret_solid(self) -> Self
On a Role::Line declaring caret: the caret is solid, not a
caret to blink (see the caret_solid field). A block caret in a
modal editor’s normal mode — the one thing that otherwise asks an
idle app for a frame twice a second.
Sourcepub fn on_key(self, tag: impl Into<Value>) -> Self
pub fn on_key(self, tag: impl Into<Value>) -> Self
Makes this node a key sink (see NodeSpec::on_key field). Pass a
tag the handler can match on; Value::Null if the node key is
identification enough.
Sourcepub fn key_sink(self) -> Self
pub fn key_sink(self) -> Self
A key sink with no tag — on_key(Value::Null), for a handler that
knows the node by its key.
Sourcepub fn key_up(self) -> Self
pub fn key_up(self) -> Self
Delivers releases to this key sink as well as presses (see the
key_up field). Meaningless without on_key.
Sourcepub fn modifier_keys(self) -> Self
pub fn modifier_keys(self) -> Self
Delivers the modifier and lock keys to this key sink as keys of
their own (see the modifier_keys field). Meaningless without
on_key.
Sourcepub fn on_force_click(self, tag: impl Into<Value>) -> Self
pub fn on_force_click(self, tag: impl Into<Value>) -> Self
Asks for force-click events on this node (see the
on_force_click field).
Asks for the non-primary buttons pressed over this node as events,
each captured by it until its release (see the on_button field):
{kind="button", phase, button, x, y, tag}. Every such button
unless NodeSpec::buttons narrows it.
Which non-primary buttons on_button claims (see the buttons
field): Buttons::MIDDLE, Buttons::SECONDARY | Buttons::MIDDLE.
Meaningless without on_button.
Sourcepub fn on_scroll(self, tag: impl Into<Value>) -> Self
pub fn on_scroll(self, tag: impl Into<Value>) -> Self
Asks for the wheel over this node as events (see the on_scroll
field): {kind="scroll", x, y, dx, dy, lines, tag}.
Sourcepub fn scroll_axes(self, axes: ScrollAxes) -> Self
pub fn scroll_axes(self, axes: ScrollAxes) -> Self
Which axes on_scroll takes (see the scroll_axes field):
ScrollAxes::Y for a terminal’s history, so a sideways gesture
passes it by. Meaningless without on_scroll.
Sourcepub fn scroll_mods(self, mods: KeyMods) -> Self
pub fn scroll_mods(self, mods: KeyMods) -> Self
The modifiers on_scroll is for (see the scroll_mods field):
KeyMods::NONE.with_ctrl().with_super() hears a wheel turned with
Ctrl or ⌘ held, ahead of every scroller under the pointer, and no
other wheel. Meaningless without on_scroll.
Asks for a context menu on this node (see the on_context_menu
field). Pass a tag the handler can match on; Value::Null if the
node key is identification enough.
Sourcepub fn transition(self, duration_ms: f32) -> Self
pub fn transition(self, duration_ms: f32) -> Self
Animates changes to this node’s sizing amounts, colors and radius
over duration_ms (cubic ease-out); see crate::anim. Only the
duration: an easing or repeat already declared survives, so the
transition props compose in any order.
On a scroll container it also eases the offset a reveal or a
set_scroll moves it to; the wheel, the thumb and a drag past the
edge still land whole.
use kui_core::{Easing, NodeSpec, Sizing};
// Eases toward whatever width the view declares next frame.
let pane = NodeSpec::column().width(Sizing::Fixed(240.0)).transition(180.0).easing(Easing::Smooth);
assert_eq!(pane.transition.unwrap().duration_ms, 180.0);Sourcepub fn transition_with(self, t: Transition) -> Self
pub fn transition_with(self, t: Transition) -> Self
The whole Transition at once, replacing any declared so far.
Sourcepub fn slide(self) -> Self
pub fn slide(self) -> Self
Also ease this node’s position (see the slide field); sets a
default 200ms transition if none was declared yet.
Sourcepub fn easing(self, easing: Easing) -> Self
pub fn easing(self, easing: Easing) -> Self
Easing for the node’s transition (sets a default 200ms one if none was declared yet).
Sourcepub fn bounce(self, bounce: f32) -> Self
pub fn bounce(self, bounce: f32) -> Self
How far the node’s spring overshoots, 0 (glides in) to
crate::anim::MAX_BOUNCE — in place of the spring easing’s own
bounce, and on a timed easing in place of the curve, making it a
spring (see Transition::bounce). Sets a default 200ms
transition if none was declared yet.
Sourcepub fn repeat(self, repeat: Repeat) -> Self
pub fn repeat(self, repeat: Repeat) -> Self
How this node’s keyframes cycle (CSS’s animation-direction);
sets a default 200ms transition if none was declared yet.
Sourcepub fn delay(self, delay_ms: f32) -> Self
pub fn delay(self, delay_ms: f32) -> Self
Holds this node’s keyframe cycle back by delay_ms (CSS’s
animation-delay), so siblings given different delays run out of
phase — a cascade, a chase light. Sets a default 200ms transition if
none was declared yet.
Sourcepub fn keyframes(self, stops: Vec<Keyframe>) -> Self
pub fn keyframes(self, stops: Vec<Keyframe>) -> Self
Cycles the slots these stops name (see the keyframes field); sets
a default 200ms transition if none was declared yet.
Sourcepub fn enter(self, enter: Enter) -> Self
pub fn enter(self, enter: Enter) -> Self
Eases this node in from enter on its first sight (see the enter
field); sets a default 200ms transition if none was declared yet.
Sourcepub fn exit(self, exit: Enter) -> Self
pub fn exit(self, exit: Enter) -> Self
Eases this node out to exit after the view stops declaring it
(see the exit field); sets a default 200ms transition if none was
declared yet.
Sourcepub fn window_drag(self) -> Self
pub fn window_drag(self) -> Self
Pressing this node starts an OS window drag (drivers promote a quick second press to a maximize toggle).
Clicking this node emits the button’s WindowCommand.
Sourcepub fn cursor(self, shape: CursorShape) -> Self
pub fn cursor(self, shape: CursorShape) -> Self
The pointer shape over this node (see the cursor field).
Trait Implementations§
Source§impl PartialEq for NodeSpec
Hand-written so that a group whose box was allocated but left at its
defaults — .checked(false) on a fresh spec — equals one whose box was
never allocated at all. The derived version compared None against
Some(EMPTY) and called them different, which is a difference the boxing
introduced rather than one a caller declared.
impl PartialEq for NodeSpec
Hand-written so that a group whose box was allocated but left at its
defaults — .checked(false) on a fresh spec — equals one whose box was
never allocated at all. The derived version compared None against
Some(EMPTY) and called them different, which is a difference the boxing
introduced rather than one a caller declared.