Add clear artboards button to undo history (#1643)
This commit is contained in:
parent
f02dd5c0f6
commit
128f76af7e
|
|
@ -42,6 +42,7 @@ pub enum DocumentMessage {
|
|||
BackupDocument {
|
||||
network: NodeNetwork,
|
||||
},
|
||||
ClearArtboards,
|
||||
ClearLayersPanel,
|
||||
CommitTransaction,
|
||||
CreateEmptyFolder {
|
||||
|
|
|
|||
|
|
@ -346,6 +346,10 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
|||
}
|
||||
}
|
||||
BackupDocument { network } => self.backup_with_document(network, responses),
|
||||
ClearArtboards => {
|
||||
self.backup(responses);
|
||||
responses.add(GraphOperationMessage::ClearArtboards);
|
||||
}
|
||||
ClearLayersPanel => {
|
||||
// Send an empty layer list
|
||||
let data_buffer: RawBuffer = Self::default().serialize_root();
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ impl LayoutHolder for MenuBarMessageHandler {
|
|||
no_active_document,
|
||||
MenuBarEntryChildren(vec![vec![MenuBarEntry {
|
||||
label: "Clear Artboards".into(),
|
||||
action: MenuBarEntry::create_action(|_| GraphOperationMessage::ClearArtboards.into()),
|
||||
action: MenuBarEntry::create_action(|_| DocumentMessage::ClearArtboards.into()),
|
||||
disabled: no_active_document,
|
||||
..MenuBarEntry::default()
|
||||
}]]),
|
||||
|
|
|
|||
Loading…
Reference in New Issue