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 {
|
BackupDocument {
|
||||||
network: NodeNetwork,
|
network: NodeNetwork,
|
||||||
},
|
},
|
||||||
|
ClearArtboards,
|
||||||
ClearLayersPanel,
|
ClearLayersPanel,
|
||||||
CommitTransaction,
|
CommitTransaction,
|
||||||
CreateEmptyFolder {
|
CreateEmptyFolder {
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,10 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BackupDocument { network } => self.backup_with_document(network, responses),
|
BackupDocument { network } => self.backup_with_document(network, responses),
|
||||||
|
ClearArtboards => {
|
||||||
|
self.backup(responses);
|
||||||
|
responses.add(GraphOperationMessage::ClearArtboards);
|
||||||
|
}
|
||||||
ClearLayersPanel => {
|
ClearLayersPanel => {
|
||||||
// Send an empty layer list
|
// Send an empty layer list
|
||||||
let data_buffer: RawBuffer = Self::default().serialize_root();
|
let data_buffer: RawBuffer = Self::default().serialize_root();
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ impl LayoutHolder for MenuBarMessageHandler {
|
||||||
no_active_document,
|
no_active_document,
|
||||||
MenuBarEntryChildren(vec![vec![MenuBarEntry {
|
MenuBarEntryChildren(vec![vec![MenuBarEntry {
|
||||||
label: "Clear Artboards".into(),
|
label: "Clear Artboards".into(),
|
||||||
action: MenuBarEntry::create_action(|_| GraphOperationMessage::ClearArtboards.into()),
|
action: MenuBarEntry::create_action(|_| DocumentMessage::ClearArtboards.into()),
|
||||||
disabled: no_active_document,
|
disabled: no_active_document,
|
||||||
..MenuBarEntry::default()
|
..MenuBarEntry::default()
|
||||||
}]]),
|
}]]),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue