add VNote::editorAndBrowserFont for setting font in QTextEdit and QTextBrowser

Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
Le Tan 2016-10-09 22:37:45 +08:00
parent 5ff4382f90
commit 321289c8e0
4 changed files with 7 additions and 0 deletions

View File

@ -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()

View File

@ -43,6 +43,7 @@ void VEditor::setupUI()
case DocType::Html:
textBrowser = new QTextBrowser();
addWidget(textBrowser);
textBrowser->setFont(VNote::editorAndBrowserFont);
webPreviewer = NULL;
break;
default:

View File

@ -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()

View File

@ -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