| 70 | } |
| 71 | |
| 72 | void DataWidget::addHighlight(const QColor &lightModeColor, const QColor &darkModeColor) { |
| 73 | QTextEdit::ExtraSelection selection; |
| 74 | |
| 75 | selection.format.setBackground(isRunningInDarkMode() ? darkModeColor : lightModeColor); |
| 76 | selection.format.setProperty(QTextFormat::FullWidthSelection, true); |
| 77 | selection.format.setProperty(QTextFormat::UserProperty, lightModeColor); |
| 78 | selection.format.setProperty(QTextFormat::UserProperty + 1, darkModeColor); |
| 79 | selection.cursor = textCursor(); |
| 80 | selection.cursor.movePosition(QTextCursor::StartOfLine); |
| 81 | |
| 82 | highlights.append(selection); |
| 83 | } |
| 84 | |
| 85 | void DataWidget::highlightCurrentLine() { |
| 86 | if (moveable) { |
no test coverage detected