Skip to main content

toolbar_group

Function toolbar_group 

Source
pub fn toolbar_group(
    id: &str,
    label: &str,
    buttons: Vec<ToolbarItem>,
) -> ToolbarItem
Expand description

Related buttons in one capsule (zoom out and in, back and forward), made by toolbar_button; one item to the overflow menu and the customisation sheet, under label.

use ferrokit::*;

let zoom = Signal::new(1.0);
let item = toolbar_group("zoom", "Zoom", vec![
    toolbar_button("out", "Zoom Out", "minus.magnifyingglass", move || zoom.update(|z| *z /= 1.25)),
    toolbar_button("in", "Zoom In", "plus.magnifyingglass", move || zoom.update(|z| *z *= 1.25)),
]);