Properly show document bar on initialization (#535)
* properly show document bar * updated comments
This commit is contained in:
parent
011f32395e
commit
f8c2be83dd
|
|
@ -781,7 +781,7 @@ impl MessageHandler<DocumentMessage, &InputPreprocessorMessageHandler> for Docum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ExportDocument => {
|
ExportDocument => {
|
||||||
// TODO(MFISH33): Add Dialog to select artboards
|
// TODO(mfish33): Add Dialog to select artboards
|
||||||
let bbox = self.document_bounds().unwrap_or_else(|| [DVec2::ZERO, ipp.viewport_bounds.size()]);
|
let bbox = self.document_bounds().unwrap_or_else(|| [DVec2::ZERO, ipp.viewport_bounds.size()]);
|
||||||
let size = bbox[1] - bbox[0];
|
let size = bbox[1] - bbox[0];
|
||||||
let name = match self.name.ends_with(FILE_SAVE_SUFFIX) {
|
let name = match self.name.ends_with(FILE_SAVE_SUFFIX) {
|
||||||
|
|
|
||||||
|
|
@ -427,6 +427,10 @@ export default defineComponent({
|
||||||
this.documentBarLayout = updateDocumentBarLayout;
|
this.documentBarLayout = updateDocumentBarLayout;
|
||||||
});
|
});
|
||||||
this.editor.dispatcher.subscribeJsMessage(TriggerViewportResize, this.viewportResize);
|
this.editor.dispatcher.subscribeJsMessage(TriggerViewportResize, this.viewportResize);
|
||||||
|
|
||||||
|
// TODO(mfish33): Replace with initialization system Issue:#524
|
||||||
|
// Get initial Document Bar
|
||||||
|
this.editor.instance.init_document_bar();
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const documentModeEntries: SectionsOfMenuListEntries = [
|
const documentModeEntries: SectionsOfMenuListEntries = [
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ export function createDocumentsState(editor: EditorState, dialogState: DialogSta
|
||||||
download(triggerFileDownload.name, triggerFileDownload.document);
|
download(triggerFileDownload.name, triggerFileDownload.document);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO(mfish33): Replace with initialization system Issue:#524
|
||||||
// Get the initial documents
|
// Get the initial documents
|
||||||
editor.instance.get_open_documents_list();
|
editor.instance.get_open_documents_list();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -525,6 +525,12 @@ impl JsEditorHandle {
|
||||||
let message = DocumentMessage::ZoomCanvasToFitAll;
|
let message = DocumentMessage::ZoomCanvasToFitAll;
|
||||||
self.dispatch(message);
|
self.dispatch(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(mfish33): Replace with initialization system Issue:#524
|
||||||
|
pub fn init_document_bar(&self) {
|
||||||
|
let message = PortfolioMessage::UpdateDocumentBar;
|
||||||
|
self.dispatch(message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Needed to make JsEditorHandle functions pub to rust. Do not fully
|
// Needed to make JsEditorHandle functions pub to rust. Do not fully
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue