Skip to content
Snippets Groups Projects
Commit ffd03aaf authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed issues with line number colors on dark themes

By using the palette foreground color for line numbers when the
background is very dark, instead of the palette's "dark" color.
parent 61a9356c
Branches
Tags
No related merge requests found
...@@ -143,10 +143,23 @@ QString FormatDescription::trName() const ...@@ -143,10 +143,23 @@ QString FormatDescription::trName() const
QColor FormatDescription::foreground() const QColor FormatDescription::foreground() const
{ {
if (m_name == QLatin1String(Constants::C_LINE_NUMBER)) if (m_name == QLatin1String(Constants::C_LINE_NUMBER)) {
return QApplication::palette().dark().color(); const QColor bg = QApplication::palette().background().color();
if (m_name == QLatin1String(Constants::C_PARENTHESES)) if (bg.value() < 128) {
return QApplication::palette().foreground().color();
} else {
return QApplication::palette().dark().color();
}
} else if (m_name == QLatin1String(Constants::C_CURRENT_LINE_NUMBER)) {
const QColor bg = QApplication::palette().background().color();
if (bg.value() < 128) {
return QApplication::palette().foreground().color();
} else {
return m_format.foreground();
}
} else if (m_name == QLatin1String(Constants::C_PARENTHESES)) {
return QColor(Qt::red); return QColor(Qt::red);
}
return m_format.foreground(); return m_format.foreground();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment