Add cut, copy, and paste to the Edit menu (#440)

* Add cut

* Hook up edit dropdown

* Use copy message
This commit is contained in:
0HyperCube
2021-12-30 11:02:57 +00:00
committed by GitHub
parent 82e63ea167
commit 62fc88264e
5 changed files with 29 additions and 3 deletions

View File

@@ -349,6 +349,24 @@ impl JsEditorHandle {
self.dispatch(message);
}
/// Cut selected layers
pub fn cut(&self) {
let message = DocumentsMessage::Cut(Clipboard::User);
self.dispatch(message);
}
/// Copy selected layers
pub fn copy(&self) {
let message = DocumentsMessage::Copy(Clipboard::User);
self.dispatch(message);
}
/// Paste selected layers
pub fn paste(&self) {
let message = DocumentsMessage::Paste(Clipboard::User);
self.dispatch(message);
}
pub fn select_layer(&self, paths: Vec<LayerId>, ctrl: bool, shift: bool) {
let message = DocumentMessage::SelectLayer(paths, ctrl, shift);
self.dispatch(message);