From 0dd4bf6816bba8369279ec8213863426d93ae5d1 Mon Sep 17 00:00:00 2001 From: enngq11k <148800743+enngq11k@users.noreply.github.com> Date: Fri, 24 Nov 2023 20:14:37 +0100 Subject: [PATCH] Cursor in text workout editor was invisible Changed the background to a lighter color to get the cursor visible again. To achive a good contrast, the text color for the selected line is now black. This combination works for dark and light mode. --- contrib/qtsolutions/codeeditor/codeeditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/qtsolutions/codeeditor/codeeditor.cpp b/contrib/qtsolutions/codeeditor/codeeditor.cpp index 812a4e7fd..43f2b09d2 100644 --- a/contrib/qtsolutions/codeeditor/codeeditor.cpp +++ b/contrib/qtsolutions/codeeditor/codeeditor.cpp @@ -117,7 +117,8 @@ void CodeEditor::highlightCurrentLine() if (!isReadOnly()) { QTextEdit::ExtraSelection selection; - selection.format.setBackground(lineAreaColor); + selection.format.setBackground(QColor(Qt::lightGray)); + selection.format.setForeground(QColor(Qt::black)); selection.format.setProperty(QTextFormat::FullWidthSelection, true); selection.cursor = textCursor(); selection.cursor.clearSelection();