forked from len0rd/rockbox
Theme Editor: Fixed bug in parser handling empty lines and made ParseTreeModel handle the new VIEWPORT element properly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26792 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0cca15c6d0
commit
3c95dbb208
6 changed files with 34 additions and 13 deletions
|
@ -146,10 +146,8 @@ void SkinDocument::settingsChanged()
|
|||
palette.setColor(QPalette::All, QPalette::Text, fg);
|
||||
editor->setPalette(palette);
|
||||
|
||||
errorColor = QTextCharFormat();
|
||||
QColor highlight = settings.value("errorColor", Qt::red).value<QColor>();
|
||||
errorColor.setBackground(highlight);
|
||||
errorColor.setProperty(QTextFormat::FullWidthSelection, true);
|
||||
editor->setErrorColor(highlight);
|
||||
|
||||
/* Setting the font */
|
||||
QFont def("Monospace");
|
||||
|
@ -175,10 +173,19 @@ void SkinDocument::codeChanged()
|
|||
if(skin_error_line() > 0)
|
||||
{
|
||||
editor->addError(skin_error_line());
|
||||
}
|
||||
else
|
||||
{
|
||||
editor->setExtraSelections(QList<QTextEdit::ExtraSelection>());
|
||||
|
||||
/* Now we're going to attempt parsing again at each line, until we find
|
||||
one that won't error out
|
||||
QTextDocument doc(editor->document()->toPlainText());
|
||||
if(skin_error_line() > 0)
|
||||
{
|
||||
QTextCursor rest(&doc);
|
||||
|
||||
for(int i = 0; i < skin_error_line(); i++)
|
||||
rest.movePosition(QTextCursor::NextBlock,
|
||||
QTextCursor::KeepAnchor);
|
||||
rest.clearSelection();
|
||||
}*/
|
||||
}
|
||||
|
||||
if(editor->document()->toPlainText() != saved)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue