use ui::widgets::{Button, ButtonRole, ButtonStyle};
Button::new("save", "Save")
.button_style(ButtonStyle::Prominent)
.on_press(cx.listener(|view, _, _, cx| view.save(cx)))
Button::new("delete", "Delete")
.role(ButtonRole::Destructive)
.icon(ui::icons::glyph::Trash)
.on_press(cx.listener(|view, _, _, cx| view.delete(cx)))- Keyboard activation needs
ui::focus::init(cx)at startup and the window root wrapped inui::focus::traversal. - The id holds focus across renders; keep it stable. A button with no
on_pressis disabled. theme.button(label, style, fade)paints the same look with no behaviour, for a control of your own.