From a74bac20c4e8de9776bf9bb77fdc7526135d1988 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 18 Nov 2015 14:41:29 +0800 Subject: [PATCH] Fix Speed graph legend is illegible on dark background. Closes #4134. --- src/gui/properties/speedplotview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/properties/speedplotview.cpp b/src/gui/properties/speedplotview.cpp index 059908e95..d4cab2611 100644 --- a/src/gui/properties/speedplotview.cpp +++ b/src/gui/properties/speedplotview.cpp @@ -230,7 +230,9 @@ void SpeedPlotView::paintEvent(QPaintEvent *) } QRectF legend_background_rect(legend_top_left, QSizeF(legend_width, legend_height)); - painter.fillRect(legend_background_rect, QColor(255, 255, 255, 128)); // 50% transparent + QColor legendBackgroundColor = QWidget::palette().color(QWidget::backgroundRole()); + legendBackgroundColor.setAlpha(128); // 50% transparent + painter.fillRect(legend_background_rect, legendBackgroundColor); int i = 0; for (QMap::const_iterator it = m_properties.begin(); it != m_properties.end(); ++it) {