mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-01-11 12:28:09 +03:00
Script editor fixed
This commit is contained in:
parent
a48d82c742
commit
87a366a59a
@ -8,6 +8,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
#include "lrscripthighlighter.h"
|
#include "lrscripthighlighter.h"
|
||||||
|
|
||||||
@ -43,7 +44,11 @@ void CodeEditor::setCompleter(QCompleter *value)
|
|||||||
void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent* event)
|
void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent* event)
|
||||||
{
|
{
|
||||||
QPainter painter(lineNumberArea);
|
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();
|
QTextBlock block = firstVisibleBlock();
|
||||||
int blockNumber = block.blockNumber();
|
int blockNumber = block.blockNumber();
|
||||||
@ -53,7 +58,7 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent* event)
|
|||||||
while (block.isValid() && top <= event->rect().bottom()) {
|
while (block.isValid() && top <= event->rect().bottom()) {
|
||||||
if (block.isVisible() && bottom >= event->rect().top()) {
|
if (block.isVisible() && bottom >= event->rect().top()) {
|
||||||
QString number = QString::number(blockNumber + 1);
|
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(),
|
painter.drawText(0, top, lineNumberArea->width(), fontMetrics().height(),
|
||||||
Qt::AlignCenter, number);
|
Qt::AlignCenter, number);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user