Skip to main content

Module widgets

Module widgets 

Source
Expand description

Widgets, grouped as catalog traits on Theme — import the group, reach the component: use ui::widgets::{Content, Controls, Icons, Layout, Scaffolding, Status};theme.group_box(), theme.tab(..).

What stays here is deliberately trait-shaped: state flags and pure math, neither of which reads the theme as a receiver.

Structs§

Button
A semantic button. Initialize crate::focus and mount its traversal handler on the window root; identity retains focus across renders.
SliderDrag
The drag payload of a Controls::slider, carrying the id of the slider the gesture started on.
SplitDrag
The drag payload of a Layout::split_handle. Shipped from here so every split speaks the same type: on_drag_move::<SplitDrag> on one container would otherwise fire for an unrelated split’s gesture.
Takeover
A flag that follows something else until the user takes it over.

Enums§

ButtonRole
Purpose is independent of emphasis: a destructive action may be quiet.
ButtonStyle
The shipped looks (the reference btnGhost / btnPrimary / btnDestructive).
SplitStyle
What a Layout::split_handle paints. Ghost is for a pane that already draws the edge itself; the strip still takes the drag.

Constants§

OPTION_CARD_HEIGHT
Default height of an Scaffolding::option_card preview frame.
OPTION_CARD_RADIUS
Corner radius of the preview frame.
SPLIT_HANDLE_HIT
Width of the divider’s grab strip: the 1px line plus zed’s own 4px of slack each side (workspace::HANDLE_HITBOX_SIZE) — a 1px target is unhittable.

Traits§

Buttons
Content
Controls
Icons
Layout
Scaffolding
Status

Functions§

axis_fraction
Where pointer falls along axis as a fraction of bounds — what a divider dragged there makes the split, and what a slider dragged there makes the value. Axis::Horizontal travels in x.
slider_fraction
Where a slider drag lands on the track it is asked about, or None when the gesture belongs to another slider. id is the one that element carries.
status_dot
A small state dot — the “working / idle / failed” bead on a row. Takes the tone from the caller so the meaning stays with the caller’s domain.