Farbvorschau und Farbauswahl hinter Farbwerten implementiert

This commit is contained in:
2026-08-09 21:57:49 +02:00
parent 0c53c919b7
commit 95f1ccb2ee
5 changed files with 541 additions and 91 deletions

View File

@@ -3,10 +3,12 @@
#include <QPlainTextEdit>
#include <QFont>
#include <QString>
#include <QTextBlock>
class LineNumberArea;
class Settings;
class SyntaxHighlighter;
class ColorIndicator;
// ---------------------------------------------------------------------------
// CodeEditor Core editing widget.
@@ -39,6 +41,12 @@ public:
QString filePath() const;
bool isModified() const;
// Öffentliche Hilfsmethoden für ColorIndicator
// (die Qt-Originale sind protected und von außen nicht erreichbar)
QTextBlock firstVisibleBlockPublic() const { return firstVisibleBlock(); }
QRectF blockBoundingGeometryPublic(const QTextBlock &b) const { return blockBoundingGeometry(b); }
QPointF contentOffsetPublic() const { return contentOffset(); }
signals:
void fileSaved(const QString &filePath);
@@ -46,6 +54,7 @@ protected:
void resizeEvent(QResizeEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
private slots:
void updateLineNumberAreaWidth(int newBlockCount);
@@ -60,5 +69,6 @@ private:
Settings *m_settings = nullptr;
LineNumberArea *m_lineNumberArea = nullptr;
SyntaxHighlighter *m_highlighter = nullptr;
ColorIndicator *m_colorIndicator = nullptr;
QString m_filePath;
};