mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Add clear artboards button to undo history (#1643)
This commit is contained in:
@@ -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()
|
||||
}]]),
|
||||
|
||||
Reference in New Issue
Block a user