ui_controls

module pkg::alloy::ui::transitionssource

What comes, goes and moves (decisions/F11.md, F11e): visuals, canvas nodes moved and faded each frame from one pose to another with no layout or painting, but for a room revealing. An element given a transition is held by a Moving element, whose canvas node the visual moves; when its owner goes, everything of it is freed as before but that canvas node, kept until the transition has played backwards, and with reveal a room of its size, shrinking, in its place. Layers, toasts, screens and switched views move the same way, by the theme's durations. Under reduced motion only fades are kept, at the short duration, unless a motion is essential.

type Posesource

exp type Pose = struct

How a canvas node is shown, from its place: its opacity, moved by x toward its end (the left right to left) and y down, scaled about its center, and how much of its room shows.

Fields

exp opacity: f32 = 1.0
exp x: f32 = 0.0
exp open: f32 = 1.0

const RESTsource

exp const REST: Pose = Pose {};

In its place, as laid out.

type Finishsource

exp type Finish = enum

What becomes of a visual's canvas node once it ends: nothing, removed (one gone), or hidden (a view hidden, shown meanwhile).

Variants

Stay
Remove
Hide

fn fitsource

exp fn fit(self ui: &Ui, pose: Pose, motion: Motion) -> Option<Fitted>

A pose and the motion to and from it, as reduced motion allows: then only its fade, at the short duration, unless the motion is essential; none when nothing would move.

type Fittedsource

exp type Fitted = struct

Fields

exp pose: Pose
exp motion: Motion

fn move_elementsource

exp fn move_element(
    self ui: &var Ui,
    element: Element,
    from: Pose,
    goal: Pose,
    motion: Motion,
    finish: Finish
)

Moves the element from one pose to another over the motion, from where a visual already moving it has it.

fn paintsource

exp fn paint(self m: &Moving, look: &Look, paint: &var Paint)

fn renewsource

exp fn renew(self m: &var Moving, next: Moving) -> Change

fn keep_goingsource

exp fn keep_going(self ui: &var Ui, index: u32, pose: Pose, motion: Motion)

Keeps what the element going drew, moving it to the pose, then gone.