Gui: allow to set font family and size and syntax highlighting

This commit is contained in:
wmayer
2019-12-19 23:17:46 +01:00
parent 99e5bededb
commit d969581ff8
6 changed files with 93 additions and 10 deletions

View File

@@ -73,7 +73,6 @@ void TextDocumentEditorView::setupEditor()
{
connect(getEditor()->document(), SIGNAL(modificationChanged(bool)),
this, SLOT(setWindowModified(bool)));
getEditor()->setReadOnly(textDocument->ReadOnly.getValue());
setWindowTitle(QString::fromUtf8(textDocument->Label.getValue())
+ QString::fromLatin1("[*]"));
getEditor()->setPlainText(
@@ -82,8 +81,10 @@ void TextDocumentEditorView::setupEditor()
void TextDocumentEditorView::setupConnection()
{
textConnection = textDocument->connect(
textConnection = textDocument->connectText(
boost::bind(&TextDocumentEditorView::sourceChanged, this));
labelConnection = textDocument->connectLabel(
boost::bind(&TextDocumentEditorView::labelChanged, this));
}
void TextDocumentEditorView::sourceChanged()
@@ -96,6 +97,12 @@ void TextDocumentEditorView::sourceChanged()
}
}
void TextDocumentEditorView::labelChanged()
{
setWindowTitle(QString::fromUtf8(textDocument->Label.getValue())
+ QString::fromLatin1("[*]"));
}
void TextDocumentEditorView::refresh()
{
QString text = QString::fromUtf8(