INNER CODE UNIT · Rust
feature_from_sel
David-OConnor/plascad · src/gui/sequence/mod.rs:82
fn feature_from_sel(state: &mut State, ui: &mut Ui) {
if let Some(text_sel) = state.ui.text_selection {
if ui
.button(RichText::new("➕ Add feature from sel").color(COLOR_ACTION))
.clicked()
{
state.generic[state.active].features.push(Feature {
range: text_sel,
label: state.ui.quick_feature_add_name.clone(),
direction: state.ui.quick_feature_add_dir,
..Default::default()
});
state.ui.text_selection = None;
state.ui.quick_feature_add_name = String::new();
}
if ui