forked from len0rd/rockbox
Theme Editor: Added syntax highlighting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26506 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1dc7f490c9
commit
6feac4a315
6 changed files with 183 additions and 7 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue