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 <QtWidgets>
|
||||||
#include "vedit.h"
|
#include "vedit.h"
|
||||||
|
#include "vnote.h"
|
||||||
|
|
||||||
VEdit::VEdit(VNoteFile *noteFile, QWidget *parent)
|
VEdit::VEdit(VNoteFile *noteFile, QWidget *parent)
|
||||||
: QTextEdit(parent), noteFile(noteFile)
|
: QTextEdit(parent), noteFile(noteFile)
|
||||||
{
|
{
|
||||||
|
setFont(VNote::editorAndBrowserFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VEdit::beginEdit()
|
void VEdit::beginEdit()
|
||||||
|
@ -43,6 +43,7 @@ void VEditor::setupUI()
|
|||||||
case DocType::Html:
|
case DocType::Html:
|
||||||
textBrowser = new QTextBrowser();
|
textBrowser = new QTextBrowser();
|
||||||
addWidget(textBrowser);
|
addWidget(textBrowser);
|
||||||
|
textBrowser->setFont(VNote::editorAndBrowserFont);
|
||||||
webPreviewer = NULL;
|
webPreviewer = NULL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -13,11 +13,13 @@ const QString VNote::defaultCssUrl = QString("qrc:/resources/markdown.css");
|
|||||||
|
|
||||||
QString VNote::templateHtml;
|
QString VNote::templateHtml;
|
||||||
QString VNote::cssUrl = VNote::defaultCssUrl;
|
QString VNote::cssUrl = VNote::defaultCssUrl;
|
||||||
|
QFont VNote::editorAndBrowserFont;
|
||||||
|
|
||||||
VNote::VNote()
|
VNote::VNote()
|
||||||
: curNotebookIndex(0)
|
: curNotebookIndex(0)
|
||||||
{
|
{
|
||||||
decorateTemplate();
|
decorateTemplate();
|
||||||
|
editorAndBrowserFont.setPointSize(11);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VNote::decorateTemplate()
|
void VNote::decorateTemplate()
|
||||||
|
2
vnote.h
2
vnote.h
@ -4,6 +4,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QFont>
|
||||||
#include "vnotebook.h"
|
#include "vnotebook.h"
|
||||||
|
|
||||||
class VNote
|
class VNote
|
||||||
@ -25,6 +26,7 @@ public:
|
|||||||
static const QString templatePath;
|
static const QString templatePath;
|
||||||
|
|
||||||
static QString templateHtml;
|
static QString templateHtml;
|
||||||
|
static QFont editorAndBrowserFont;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Write notebooks section of global config
|
// Write notebooks section of global config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user