From 6feac4a315574b9cc037a328018e6ba9398a77d5 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Thu, 3 Jun 2010 07:38:59 +0000 Subject: Theme Editor: Added syntax highlighting git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26506 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/editorwindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utils/themeeditor/editorwindow.cpp') diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp index feaac6fe47..ada9ecd137 100644 --- a/utils/themeeditor/editorwindow.cpp +++ b/utils/themeeditor/editorwindow.cpp @@ -34,6 +34,11 @@ EditorWindow::EditorWindow(QWidget *parent) : tree = new ParseTreeModel(ui->code->document()->toPlainText().toAscii()); ui->parseTree->setModel(tree); + /* Setting up the syntax highlighter */ + highlighter = new SkinHighlighter(QColor(0,255,0), QColor(255,0,0), + QColor(0,0,255), QColor(150,150,150), + ui->code->document()); + /* Connecting the buttons */ QObject::connect(ui->code, SIGNAL(cursorPositionChanged()), this, SLOT(updateTree())); @@ -50,7 +55,7 @@ void EditorWindow::updateTree() void EditorWindow::updateCode() { tree->genCode(); - ui->code->setDocument(new QTextDocument(tree->genCode())); + ui->code->document()->setPlainText(tree->genCode()); } EditorWindow::~EditorWindow() -- cgit v1.2.3