diff --git a/libs/widgets/qcodeedit.cpp b/libs/widgets/qcodeedit.cpp index e23cd48..f5383e5 100644 --- a/libs/widgets/qcodeedit.cpp +++ b/libs/widgets/qcodeedit.cpp @@ -54,6 +54,7 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent), ui(new Ui::QCodeEdit) { qRegisterMetaType(); qRegisterMetaType(); ui->setupUi(this); + detectTheme(); overlay = new _QCE_Viewport(ui->textCode->viewport()); overlay->ce = this; overlay->show(); @@ -879,8 +880,8 @@ void QCodeEdit::highlightBrackets() { QColor inverseColorValue(const QColor & c) { int hsv[4]; - c.getHsv(&hsv[0], &hsv[1], &hsv[2], &hsv[3]); - return QColor::fromHsv(hsv[0], hsv[1], 255 - hsv[2], hsv[3]); + c.getHsl(&hsv[0], &hsv[1], &hsv[2], &hsv[3]); + return QColor::fromHsl(hsv[0], hsv[1], 255 - hsv[2], hsv[3]); } QBrush QCodeEdit::invertedBrush(const QBrush & b) { auto ret = b;