mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 03:18:06 +08:00
Make frontend request tab list on initialization
This commit is contained in:
@@ -35,6 +35,7 @@ pub enum DocumentMessage {
|
||||
CloseAllDocumentsWithConfirmation,
|
||||
CloseAllDocuments,
|
||||
NewDocument,
|
||||
GetOpenDocumentsList,
|
||||
NextDocument,
|
||||
PrevDocument,
|
||||
ExportDocument,
|
||||
@@ -303,6 +304,11 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
|
||||
);
|
||||
responses.push_back(SelectDocument(self.active_document_index).into());
|
||||
}
|
||||
GetOpenDocumentsList => {
|
||||
// Send the list of document tab names
|
||||
let open_documents = self.documents.iter().map(|doc| doc.name.clone()).collect();
|
||||
responses.push_back(FrontendMessage::UpdateOpenDocumentsList { open_documents }.into());
|
||||
}
|
||||
NextDocument => {
|
||||
let id = (self.active_document_index + 1) % self.documents.len();
|
||||
responses.push_back(SelectDocument(id).into());
|
||||
|
||||
Reference in New Issue
Block a user