Sigil

Axis drag

Drag along one axis.

GUITUIRuns in the browseraxis_drag

Preview

Axis drag, Dragged, light themeAxis drag, Dragged, dark theme

Usage example

fn axis_drag_demo() -> NodeBuilder {    let width = signal(160.0_f32);    let handle = container()        .layout(LayoutStyle::flex_column().width(width.peek()))        .child(card(            text(move || format!("Width {:.0}", width.get())).nowrap(),        ));    axis_drag(        handle,        Axis::X,        move || width.peek(),        move |start, delta| width.set((start + delta).max(80.0)),        || {},    )}
fn axis_drag_demo() -> NodeBuilder {  let width = signal(160.0_f32);  let handle = container()    .layout(      LayoutStyle::flex_column()        .width(width.peek()),    )    .child(card(      text(move || {        format!(          "Width {:.0}",          width.get()        )      })      .nowrap(),    ));  axis_drag(    handle,    Axis::X,    move || width.peek(),    move |start, delta| {      width        .set((start + delta).max(80.0))    },    || {},  )}

States

All 3 captured states, each drawn by the window host and by the terminal host.

  • Axis drag, Default, light themeAxis drag, Default, dark theme
    Default
  • Axis drag, Hover, light themeAxis drag, Hover, dark theme
    Hover
  • Axis drag, Dragged, light themeAxis drag, Dragged, dark theme
    Dragged

API

NameSignaturePurpose
axis_dragfn axis_drag<S>(node, axis: Axis, snapshot, on_delta, on_end) -> NodeBuilderDrag along one axis.