Clear properties panel and layer tree on close (#920)

* Clear properties panel and layer tree on close

* Fix on close all documents

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2022-12-28 14:44:11 +00:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 002b0fc1dd
commit 509aab72c1
4 changed files with 47 additions and 15 deletions
@@ -47,6 +47,7 @@ pub enum DocumentMessage {
aggregate: AlignAggregate,
},
BooleanOperation(BooleanOperationType),
ClearLayerTree,
CommitTransaction,
CreateEmptyFolder {
container_path: Vec<LayerId>,
@@ -243,6 +243,20 @@ impl MessageHandler<DocumentMessage, (u64, &InputPreprocessorMessageHandler, &Pe
);
responses.push_back(CommitTransaction.into());
}
ClearLayerTree => {
// Send an empty layer tree
let data_buffer: RawBuffer = Self::default().serialize_root().into();
responses.push_back(FrontendMessage::UpdateDocumentLayerTreeStructure { data_buffer }.into());
// Clear the options bar
responses.push_back(
LayoutMessage::SendLayout {
layout: Layout::WidgetLayout(Default::default()),
layout_target: LayoutTarget::LayerTreeOptions,
}
.into(),
);
}
CommitTransaction => (),
CreateEmptyFolder { mut container_path } => {
let id = generate_uuid();