Skip to content

Commit 7d2fe04

Browse files
committedJan 24, 2019
Fix default highlighted text colors for code editors (fixes #21080)
1 parent e6368a4 commit 7d2fe04

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/gui/qgscodeeditor.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,14 @@ void QgsCodeEditor::setSciWidget()
101101
colors.insert( key, QgsSymbolLayerUtils::decodeColor( ini.value( key ).toString() ) );
102102
}
103103
}
104+
QPalette pal = qApp->palette();
104105

105106
setUtf8( true );
106107
setCaretLineVisible( true );
107108
setCaretLineBackgroundColor( colors.value( QStringLiteral( "caretLineColor" ), QColor( 252, 243, 237 ) ) );
108109
setCaretForegroundColor( colors.value( QStringLiteral( "cursorColor" ), QColor( 51, 51, 51 ) ) );
109-
setSelectionForegroundColor( colors.value( QStringLiteral( "selectionForegroundColorEditor" ), QColor( 48, 48, 48 ) ) );
110-
setSelectionBackgroundColor( colors.value( QStringLiteral( "selectionBackgroundColor" ), QColor( 251, 251, 251 ) ) );
110+
setSelectionForegroundColor( colors.value( QStringLiteral( "selectionForegroundColor" ), pal.color( QPalette::HighlightedText ) ) );
111+
setSelectionBackgroundColor( colors.value( QStringLiteral( "selectionBackgroundColor" ), pal.color( QPalette::Highlight ) ) );
111112

112113
setBraceMatching( QsciScintilla::SloppyBraceMatch );
113114
setMatchedBraceBackgroundColor( colors.value( QStringLiteral( "matchedBraceColor" ), QColor( 183, 249, 7 ) ) );

0 commit comments

Comments
 (0)
Please sign in to comment.