mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
add VNote::editorAndBrowserFont for setting font in QTextEdit and QTextBrowser
Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
parent
5ff4382f90
commit
321289c8e0
@ -1,9 +1,11 @@
|
||||
#include <QtWidgets>
|
||||
#include "vedit.h"
|
||||
#include "vnote.h"
|
||||
|
||||
VEdit::VEdit(VNoteFile *noteFile, QWidget *parent)
|
||||
: QTextEdit(parent), noteFile(noteFile)
|
||||
{
|
||||
setFont(VNote::editorAndBrowserFont);
|
||||
}
|
||||
|
||||
void VEdit::beginEdit()
|
||||
|
@ -43,6 +43,7 @@ void VEditor::setupUI()
|
||||
case DocType::Html:
|
||||
textBrowser = new QTextBrowser();
|
||||
addWidget(textBrowser);
|
||||
textBrowser->setFont(VNote::editorAndBrowserFont);
|
||||
webPreviewer = NULL;
|
||||
break;
|
||||
default:
|
||||
|
@ -13,11 +13,13 @@ const QString VNote::defaultCssUrl = QString("qrc:/resources/markdown.css");
|
||||
|
||||
QString VNote::templateHtml;
|
||||
QString VNote::cssUrl = VNote::defaultCssUrl;
|
||||
QFont VNote::editorAndBrowserFont;
|
||||
|
||||
VNote::VNote()
|
||||
: curNotebookIndex(0)
|
||||
{
|
||||
decorateTemplate();
|
||||
editorAndBrowserFont.setPointSize(11);
|
||||
}
|
||||
|
||||
void VNote::decorateTemplate()
|
||||
|
2
vnote.h
2
vnote.h
@ -4,6 +4,7 @@
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <QSettings>
|
||||
#include <QFont>
|
||||
#include "vnotebook.h"
|
||||
|
||||
class VNote
|
||||
@ -25,6 +26,7 @@ public:
|
||||
static const QString templatePath;
|
||||
|
||||
static QString templateHtml;
|
||||
static QFont editorAndBrowserFont;
|
||||
|
||||
private:
|
||||
// Write notebooks section of global config
|
||||
|
Loading…
x
Reference in New Issue
Block a user