mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
Add cut, copy, and paste to the Edit menu (#440)
* Add cut * Hook up edit dropdown * Use copy message
This commit is contained in:
committed by
Keavon Chambers
parent
fd1ddfc41e
commit
451c9fcd46
@@ -23,6 +23,7 @@ static CLIPBOARD_COUNT: u8 = Clipboard::_ClipboardCount as u8;
|
||||
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum DocumentsMessage {
|
||||
Copy(Clipboard),
|
||||
Cut(Clipboard),
|
||||
PasteIntoFolder {
|
||||
clipboard: Clipboard,
|
||||
path: Vec<LayerId>,
|
||||
@@ -352,6 +353,10 @@ impl MessageHandler<DocumentsMessage, &InputPreprocessor> for DocumentsMessageHa
|
||||
}
|
||||
}
|
||||
}
|
||||
Cut(clipboard) => {
|
||||
responses.push_back(Copy(clipboard).into());
|
||||
responses.push_back(DeleteSelectedLayers.into());
|
||||
}
|
||||
Paste(clipboard) => {
|
||||
let document = self.active_document();
|
||||
let shallowest_common_folder = document
|
||||
@@ -407,6 +412,7 @@ impl MessageHandler<DocumentsMessage, &InputPreprocessor> for DocumentsMessageHa
|
||||
if self.active_document().layer_data.values().any(|data| data.selected) {
|
||||
let select = actions!(DocumentsMessageDiscriminant;
|
||||
Copy,
|
||||
Cut,
|
||||
);
|
||||
common.extend(select);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user