Copy and Paste in the timeline's feature menu (#1131)

The feature menu of the bottom timeline and the side history gets Copy (the selection, or the right-clicked feature) and Paste (at the marker). Ctrl+click in the bottom timeline toggles a feature in the selection (#1034).
This commit is contained in:
JIJINBEI authored and GitHub committed 2026-10-14 13:24:04 -04:00
1 parent c26da73f5f
commit 3dbdb71e59
2 files changed
+117 -13

No files matched your search

+3 -13
View File
@@ -5,7 +5,7 @@ use serde_json::json;
use solidcraft_engine::doc::FeatureKind;
use crate::theme::Tokens;
use crate::timeline::{delete_feature, delete_features, icon_of, transport_glyph};
use crate::timeline::{clipboard_buttons, delete_feature, delete_features, icon_of, selected_feature_ids, transport_glyph};
use crate::{SolveApp, icons};
const FOLDER_INDENT: f32 = 14.0;
@@ -209,18 +209,6 @@ fn group_for(groups: &[solidcraft_engine::doc::TimelineGroup], feature: u64) ->
groups.iter().find(|group| group.features.contains(&feature)).map(|group| group.id)
}
fn selected_feature_ids(app: &SolveApp) -> Vec<u64> {
app.session
.doc
.features
.iter()
.filter(|feature| {
app.session.selection.iter().any(|selection| matches!(selection, solidcraft_engine::Sel::Feature { id } if *id == feature.id))
})
.map(|feature| feature.id)
.collect()
}
fn selected_drag_items(app: &SolveApp, origin_x: f32, source_group: Option<u64>) -> DragItems {
DragItems { features: selected_feature_ids(app), groups: app.tree.picked_timeline_groups.clone(), origin_x, source_group }
}
@@ -797,6 +785,8 @@ fn vertical_features(app: &mut SolveApp, ui: &mut egui::Ui) {
ui.close();
}
ui.separator();
clipboard_buttons(app, ui, *id);
ui.separator();
selection_actions(app, ui, &groups);
ui.separator();
if ui.button("Delete").clicked() {