summaryrefslogtreecommitdiff
path: root/utils/themeeditor/skindocument.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-11 19:51:34 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-11 19:51:34 +0000
commit3c95dbb20859debe99edc874c57ddaa6f3acf3d2 (patch)
tree5198c578f6f4d769578676b94035824731b15771 /utils/themeeditor/skindocument.cpp
parent0cca15c6d03991b9c169fdf4e0760f90928712a0 (diff)
downloadrockbox-3c95dbb20859debe99edc874c57ddaa6f3acf3d2.zip
rockbox-3c95dbb20859debe99edc874c57ddaa6f3acf3d2.tar.gz
rockbox-3c95dbb20859debe99edc874c57ddaa6f3acf3d2.tar.bz2
rockbox-3c95dbb20859debe99edc874c57ddaa6f3acf3d2.tar.xz
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
Diffstat (limited to 'utils/themeeditor/skindocument.cpp')
-rw-r--r--utils/themeeditor/skindocument.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp
index b67c70d..8547aaf 100644
--- a/utils/themeeditor/skindocument.cpp
+++ b/utils/themeeditor/skindocument.cpp
@@ -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)