dark works

This commit is contained in:
2024-01-18 18:18:29 +03:00
parent a93db66d78
commit 64f3448b5c

View File

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