mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
small fix
This commit is contained in:
parent
bc11a8d0af
commit
d376d1125e
@ -26,19 +26,14 @@ class GraphPreviewer {
|
|||||||
{ passive: true });
|
{ passive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Interface 1.
|
||||||
previewGraph(p_id, p_timeStamp, p_lang, p_text) {
|
previewGraph(p_id, p_timeStamp, p_lang, p_text) {
|
||||||
if (p_text.length == 0) {
|
if (p_text.length == 0) {
|
||||||
this.setGraphPreviewData(p_id, p_timeStamp);
|
this.setGraphPreviewData(p_id, p_timeStamp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.firstPreview) {
|
this.initOnFirstPreview();
|
||||||
this.firstPreview = false;
|
|
||||||
|
|
||||||
let contentStyle = window.getComputedStyle(this.vnotex.contentContainer);
|
|
||||||
this.currentColor = contentStyle.getPropertyValue('color');
|
|
||||||
console.log('currentColor', this.currentColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p_lang === 'flow' || p_lang === 'flowchart') {
|
if (p_lang === 'flow' || p_lang === 'flowchart') {
|
||||||
this.vnotex.getWorker('flowchartjs').renderText(this.container,
|
this.vnotex.getWorker('flowchartjs').renderText(this.container,
|
||||||
@ -92,6 +87,29 @@ class GraphPreviewer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Interface 2.
|
||||||
|
previewMath(p_id, p_timeStamp, p_text) {
|
||||||
|
if (p_text.length == 0) {
|
||||||
|
this.setMathPreviewData(p_id, p_timeStamp);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.initOnFirstPreview();
|
||||||
|
|
||||||
|
// Do we need to go through TexMath plugin? I don't think so.
|
||||||
|
this.renderMath(p_id, p_timeStamp, p_text, this.setMathPreviewData.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
initOnFirstPreview() {
|
||||||
|
if (this.firstPreview) {
|
||||||
|
this.firstPreview = false;
|
||||||
|
|
||||||
|
let contentStyle = window.getComputedStyle(this.vnotex.contentContainer);
|
||||||
|
this.currentColor = contentStyle.getPropertyValue('color');
|
||||||
|
console.log('currentColor', this.currentColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
renderMath(p_id, p_timeStamp, p_text, p_dataSetter) {
|
renderMath(p_id, p_timeStamp, p_text, p_dataSetter) {
|
||||||
let func = function(p_previewer, p_id, p_timeStamp) {
|
let func = function(p_previewer, p_id, p_timeStamp) {
|
||||||
let previewer = p_previewer;
|
let previewer = p_previewer;
|
||||||
@ -162,11 +180,6 @@ class GraphPreviewer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
previewMath(p_id, p_timeStamp, p_text) {
|
|
||||||
// Do we need to go through TexMath plugin? I don't think so.
|
|
||||||
this.renderMath(p_id, p_timeStamp, p_text, this.setMathPreviewData.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix SVG with width and height being '100%'.
|
// Fix SVG with width and height being '100%'.
|
||||||
fixSvgRelativeWidth(p_svgNode) {
|
fixSvgRelativeWidth(p_svgNode) {
|
||||||
if (p_svgNode.getAttribute('width').indexOf('%') != -1) {
|
if (p_svgNode.getAttribute('width').indexOf('%') != -1) {
|
||||||
|
@ -753,8 +753,9 @@ int ViewWindow::checkFileMissingOrChangedOutside()
|
|||||||
} else if (m_buffer->checkFileChangedOutside()) {
|
} else if (m_buffer->checkFileChangedOutside()) {
|
||||||
int ret = MessageBoxHelper::questionSaveDiscardCancel(MessageBoxHelper::Warning,
|
int ret = MessageBoxHelper::questionSaveDiscardCancel(MessageBoxHelper::Warning,
|
||||||
tr("File is changed from outside (%1).").arg(m_buffer->getPath()),
|
tr("File is changed from outside (%1).").arg(m_buffer->getPath()),
|
||||||
tr("Do you want to override the file from buffer?"),
|
tr("Do you want to save the buffer to the file to override, or discard the buffer?"),
|
||||||
tr("The file is changed from outside. Please choose to save the buffer to the file or just discard the buffer and reload the file."),
|
tr("The file is changed from outside. Please choose to save the buffer to the file or "
|
||||||
|
"just discard the buffer and reload the file."),
|
||||||
this);
|
this);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case QMessageBox::Save:
|
case QMessageBox::Save:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user