Skip to content

Commit cef0ec2

Browse files
committed
Add "Delete all after" to the timeline context menu
Add "Delete all after" to the timeline context menu
1 parent 6c933ac commit cef0ec2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/com/commonwealthrobotics/TimelineManager.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ private void update(boolean clear) {
365365
// Add the delete item to the context menu
366366
contextMenu.getItems().add(deleteItem);
367367

368+
// Add "Delete all after" to the timeline context menu
369+
MenuItem deleteAfterItem = new MenuItem("Delete all after");
370+
deleteAfterItem.setOnAction(event -> {
371+
contextMenu.hide();
372+
if (ap.get().isRegenerating() || !ap.get().isInitialized())
373+
return;
374+
375+
ap.get().deleteTailFromCurrent();
376+
377+
});
378+
contextMenu.getItems().add(deleteAfterItem);
379+
368380
});
369381
// Add event handler for right-click
370382
} catch (Exception ex) {

0 commit comments

Comments
 (0)