Implement closing the current, and all, documents from the menu bar (#265)

Closes #261
Additional cleanup and refactoring with the way the backend relays the list of open documents to the frontend and prompts for confirmation.
This commit is contained in:
Keavon Chambers
2021-07-14 16:13:58 -07:00
parent f7e5dd1a4f
commit ccea88dfd7
9 changed files with 148 additions and 75 deletions

View File

@@ -12,14 +12,14 @@ pub enum FrontendMessage {
ExpandFolder { path: Vec<LayerId>, children: Vec<LayerPanelEntry> },
SetActiveTool { tool_name: String },
SetActiveDocument { document_index: usize },
CloseDocument { document_index: usize },
NewDocument { document_name: String },
UpdateOpenDocumentsList { open_documents: Vec<String> },
PromptConfirmationToCloseDocument { document_index: usize },
PromptConfirmationToCloseAllDocuments,
UpdateCanvas { document: String },
ExportDocument { document: String },
EnableTextInput,
DisableTextInput,
UpdateWorkingColors { primary: Color, secondary: Color },
PromptCloseConfirmationModal,
SetCanvasZoom { new_zoom: f64 },
SetRotation { new_radians: f64 },
}
@@ -44,7 +44,6 @@ impl MessageHandler<FrontendMessage, ()> for FrontendMessageHandler {
CollapseFolder,
ExpandFolder,
SetActiveTool,
NewDocument,
UpdateCanvas,
EnableTextInput,
DisableTextInput,