mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09:52 +08:00
add menu item to enable the image preview
Not visible because we now could not handle the undo history very well.
This commit is contained in:
parent
a8614839d9
commit
8649f4f66f
@ -381,6 +381,15 @@ void VMainWindow::initMarkdownMenu()
|
|||||||
this, &VMainWindow::enableCodeBlockHighlight);
|
this, &VMainWindow::enableCodeBlockHighlight);
|
||||||
markdownMenu->addAction(codeBlockAct);
|
markdownMenu->addAction(codeBlockAct);
|
||||||
codeBlockAct->setChecked(vconfig.getEnableCodeBlockHighlight());
|
codeBlockAct->setChecked(vconfig.getEnableCodeBlockHighlight());
|
||||||
|
|
||||||
|
QAction *previewImageAct = new QAction(tr("Preview Images In Edit Mode"), this);
|
||||||
|
previewImageAct->setToolTip(tr("Enable image preview in edit mode"));
|
||||||
|
previewImageAct->setCheckable(true);
|
||||||
|
connect(previewImageAct, &QAction::triggered,
|
||||||
|
this, &VMainWindow::enableImagePreview);
|
||||||
|
// TODO: add the action to the menu after handling the UNDO history well.
|
||||||
|
// markdownMenu->addAction(previewImageAct);
|
||||||
|
previewImageAct->setChecked(vconfig.getEnablePreviewImages());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VMainWindow::initViewMenu()
|
void VMainWindow::initViewMenu()
|
||||||
@ -1274,6 +1283,11 @@ void VMainWindow::enableCodeBlockHighlight(bool p_checked)
|
|||||||
vconfig.setEnableCodeBlockHighlight(p_checked);
|
vconfig.setEnableCodeBlockHighlight(p_checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VMainWindow::enableImagePreview(bool p_checked)
|
||||||
|
{
|
||||||
|
vconfig.setEnablePreviewImages(p_checked);
|
||||||
|
}
|
||||||
|
|
||||||
void VMainWindow::shortcutHelp()
|
void VMainWindow::shortcutHelp()
|
||||||
{
|
{
|
||||||
QString locale = VUtils::getLocale();
|
QString locale = VUtils::getLocale();
|
||||||
|
@ -76,6 +76,7 @@ private slots:
|
|||||||
void changeAutoIndent(bool p_checked);
|
void changeAutoIndent(bool p_checked);
|
||||||
void changeAutoList(bool p_checked);
|
void changeAutoList(bool p_checked);
|
||||||
void enableCodeBlockHighlight(bool p_checked);
|
void enableCodeBlockHighlight(bool p_checked);
|
||||||
|
void enableImagePreview(bool p_checked);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user