Hook up layer tree structure with frontend (#372)

* Hook up layer tree structure with frontend (decoding and Vue are WIP)

* Fix off by one error

* Avoid leaking memory

* Parse layer structure into list of layers

* Fix thumbnail updates

* Correctly popagate deletions

* Fix selection state in layer tree

* Respect expansion during root serialization

* Allow expanding of subfolders

* Fix arrow direction

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers
2021-09-11 17:15:51 -07:00
co-authored by Dennis Kobert
parent 88bb24a206
commit f5e03df80b
19 changed files with 15777 additions and 336 deletions
@@ -1,4 +1,4 @@
use crate::document::layer_panel::{LayerPanelEntry, Path};
use crate::document::layer_panel::{LayerPanelEntry, Path, RawBuffer};
use crate::message_prelude::*;
use crate::tool::tool_options::ToolOptions;
use crate::Color;
@@ -7,8 +7,7 @@ use serde::{Deserialize, Serialize};
#[impl_message(Message, Frontend)]
#[derive(PartialEq, Clone, Deserialize, Serialize, Debug)]
pub enum FrontendMessage {
CollapseFolder { path: Path },
ExpandFolder { path: Path, children: Vec<LayerPanelEntry> },
DisplayFolderTreeStructure { data_buffer: RawBuffer },
SetActiveTool { tool_name: String, tool_options: Option<ToolOptions> },
SetActiveDocument { document_index: usize },
UpdateOpenDocumentsList { open_documents: Vec<String> },
@@ -16,9 +15,9 @@ pub enum FrontendMessage {
DisplayPanic { panic_info: String, title: String, description: String },
DisplayConfirmationToCloseDocument { document_index: usize },
DisplayConfirmationToCloseAllDocuments,
UpdateLayer { path: Path, data: LayerPanelEntry },
UpdateCanvas { document: String },
UpdateScrollbars { position: (f64, f64), size: (f64, f64), multiplier: (f64, f64) },
UpdateLayer { path: Path, data: LayerPanelEntry },
ExportDocument { document: String, name: String },
SaveDocument { document: String, name: String },
OpenDocumentBrowse,