diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-06-03 07:38:59 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-06-03 07:38:59 +0000 |
| commit | 6feac4a315574b9cc037a328018e6ba9398a77d5 (patch) | |
| tree | dc72d398a354ee9bc01cc4cc3ae24bad857460c4 /utils/themeeditor/editorwindow.cpp | |
| parent | 1dc7f490c91993a06b0de1988efece102353455f (diff) | |
| download | rockbox-6feac4a315574b9cc037a328018e6ba9398a77d5.zip rockbox-6feac4a315574b9cc037a328018e6ba9398a77d5.tar.gz rockbox-6feac4a315574b9cc037a328018e6ba9398a77d5.tar.bz2 rockbox-6feac4a315574b9cc037a328018e6ba9398a77d5.tar.xz | |
Theme Editor: Added syntax highlighting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26506 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/editorwindow.cpp')
| -rw-r--r-- | utils/themeeditor/editorwindow.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp index feaac6f..ada9ecd 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() |