From 87a366a59a7174b7c178a4c4e54e109e4ea0fcd4 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Thu, 5 Oct 2017 01:28:24 +0300 Subject: [PATCH] Script editor fixed --- limereport/scripteditor/lrcodeeditor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/limereport/scripteditor/lrcodeeditor.cpp b/limereport/scripteditor/lrcodeeditor.cpp index 97b300e..c1b5643 100644 --- a/limereport/scripteditor/lrcodeeditor.cpp +++ b/limereport/scripteditor/lrcodeeditor.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "lrscripthighlighter.h" @@ -43,7 +44,11 @@ void CodeEditor::setCompleter(QCompleter *value) void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent* event) { QPainter painter(lineNumberArea); - painter.fillRect(event->rect(), QPalette().background().color()); + QStyleOption option; + option.initFrom(this); + //painter.fillRect(event->rect(), QPalette().background().color()); + QColor bg = option.palette.background().color().darker(150); + painter.fillRect(event->rect(), bg); QTextBlock block = firstVisibleBlock(); int blockNumber = block.blockNumber(); @@ -53,7 +58,7 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent* event) while (block.isValid() && top <= event->rect().bottom()) { if (block.isVisible() && bottom >= event->rect().top()) { QString number = QString::number(blockNumber + 1); - painter.setPen(QPalette().text().color()); + painter.setPen(option.palette.text().color()); painter.drawText(0, top, lineNumberArea->width(), fontMetrics().height(), Qt::AlignCenter, number); }