Refactor painting of editor gutter

This commit is contained in:
eelke 2022-04-10 10:29:40 +02:00
parent e082a5731d
commit a5563949e5
7 changed files with 188 additions and 85 deletions

View file

@ -13,7 +13,6 @@ class CodeEditor : public QPlainTextEdit
public:
explicit CodeEditor(QWidget *parent = nullptr);
void gutterAreaPaintEvent(QPaintEvent *event);
int gutterAreaWidth();
void addErrorMarker(int position, int length);
@ -47,9 +46,16 @@ private:
int m_tabSize = 0; // tabSize in characters
bool m_useTab = false;
void updateExtraSelections();
bool lineHasError(int blockNumber) const;
void updateExtraSelections();
bool indentSelection(bool indent);
void drawGutterErrorMarker(QPainter &painter, int top);
void insertIndentation(QTextCursor &cursor);
void removeIndentation(QTextCursor &cursor);
void makeSelection(QTextCursor &cursor, int first_pos, int end_block);
friend class GutterPainter;
};
#endif // CODEEDITOR_H