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