diff options
Diffstat (limited to 'utils/themeeditor')
-rw-r--r-- | utils/themeeditor/codeeditor.cpp | 10 | ||||
-rw-r--r-- | utils/themeeditor/codeeditor.h | 3 | ||||
-rw-r--r-- | utils/themeeditor/skindocument.cpp | 13 |
3 files changed, 13 insertions, 13 deletions
diff --git a/utils/themeeditor/codeeditor.cpp b/utils/themeeditor/codeeditor.cpp index 672b210d2e..d4b46ac52e 100644 --- a/utils/themeeditor/codeeditor.cpp +++ b/utils/themeeditor/codeeditor.cpp | |||
@@ -128,9 +128,15 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event) | |||
128 | while (block.isValid() && top <= event->rect().bottom()) { | 128 | while (block.isValid() && top <= event->rect().bottom()) { |
129 | if (block.isVisible() && bottom >= event->rect().top()) { | 129 | if (block.isVisible() && bottom >= event->rect().top()) { |
130 | QString number = QString::number(blockNumber + 1); | 130 | QString number = QString::number(blockNumber + 1); |
131 | /* Drawing an error circle if necessary */ | ||
132 | if(errors.contains(blockNumber + 1)) | ||
133 | { | ||
134 | painter.fillRect(QRect(0, top, lineNumberArea->width(), | ||
135 | fontMetrics().height()), Qt::red); | ||
136 | } | ||
131 | painter.setPen(Qt::black); | 137 | painter.setPen(Qt::black); |
132 | painter.drawText(0, top, lineNumberArea->width(), fontMetrics().height(), | 138 | painter.drawText(0, top, lineNumberArea->width(), |
133 | Qt::AlignRight, number); | 139 | fontMetrics().height(), Qt::AlignRight, number); |
134 | } | 140 | } |
135 | 141 | ||
136 | block = block.next(); | 142 | block = block.next(); |
diff --git a/utils/themeeditor/codeeditor.h b/utils/themeeditor/codeeditor.h index edbe218ec4..ec36d50c22 100644 --- a/utils/themeeditor/codeeditor.h +++ b/utils/themeeditor/codeeditor.h | |||
@@ -59,6 +59,8 @@ public: | |||
59 | 59 | ||
60 | void lineNumberAreaPaintEvent(QPaintEvent *event); | 60 | void lineNumberAreaPaintEvent(QPaintEvent *event); |
61 | int lineNumberAreaWidth(); | 61 | int lineNumberAreaWidth(); |
62 | void addError(int line){ errors.append(line); } | ||
63 | void clearErrors(){ errors.clear(); } | ||
62 | 64 | ||
63 | protected: | 65 | protected: |
64 | void resizeEvent(QResizeEvent *event); | 66 | void resizeEvent(QResizeEvent *event); |
@@ -69,6 +71,7 @@ private slots: | |||
69 | 71 | ||
70 | private: | 72 | private: |
71 | QWidget *lineNumberArea; | 73 | QWidget *lineNumberArea; |
74 | QList<int> errors; | ||
72 | }; | 75 | }; |
73 | 76 | ||
74 | //![codeeditordefinition] | 77 | //![codeeditordefinition] |
diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp index f7c902f30f..b67c70db61 100644 --- a/utils/themeeditor/skindocument.cpp +++ b/utils/themeeditor/skindocument.cpp | |||
@@ -166,6 +166,7 @@ void SkinDocument::settingsChanged() | |||
166 | 166 | ||
167 | void SkinDocument::codeChanged() | 167 | void SkinDocument::codeChanged() |
168 | { | 168 | { |
169 | editor->clearErrors(); | ||
169 | parseStatus = model->changeTree(editor->document()-> | 170 | parseStatus = model->changeTree(editor->document()-> |
170 | toPlainText().toAscii()); | 171 | toPlainText().toAscii()); |
171 | statusLabel->setText(parseStatus); | 172 | statusLabel->setText(parseStatus); |
@@ -173,17 +174,7 @@ void SkinDocument::codeChanged() | |||
173 | /* Highlighting if an error was found */ | 174 | /* Highlighting if an error was found */ |
174 | if(skin_error_line() > 0) | 175 | if(skin_error_line() > 0) |
175 | { | 176 | { |
176 | QList<QTextEdit::ExtraSelection> highlight; | 177 | editor->addError(skin_error_line()); |
177 | QTextEdit::ExtraSelection error; | ||
178 | |||
179 | /* Finding the apropriate line */ | ||
180 | error.cursor = QTextCursor(editor->document()-> | ||
181 | findBlockByNumber(skin_error_line() - 1)); | ||
182 | error.format = errorColor; | ||
183 | highlight.append(error); | ||
184 | |||
185 | editor->setExtraSelections(highlight); | ||
186 | |||
187 | } | 178 | } |
188 | else | 179 | else |
189 | { | 180 | { |