From 01e48494661433259bf3e9e6326cab4003607d33 Mon Sep 17 00:00:00 2001 From: nirvn Date: Thu, 17 Oct 2019 10:36:26 +0700 Subject: [PATCH] [maptip] Fix illegible map tips with dark themes (fixes #32288) --- src/gui/qgsmaptip.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/qgsmaptip.cpp b/src/gui/qgsmaptip.cpp index bc83dfbdcc1..dfeea12cc18 100644 --- a/src/gui/qgsmaptip.cpp +++ b/src/gui/qgsmaptip.cpp @@ -67,7 +67,7 @@ void QgsMapTip::showMapTip( QgsMapLayer *pLayer, // Show the maptip on the canvas QString tipText, lastTipText, tipHtml, bodyStyle, containerStyle, - backgroundColor, strokeColor; + backgroundColor, strokeColor, textColor; delete mWidget; mWidget = new QWidget( pMapCanvas ); @@ -108,6 +108,7 @@ void QgsMapTip::showMapTip( QgsMapLayer *pLayer, backgroundColor = mWidget->palette().base().color().name(); strokeColor = mWidget->palette().shadow().color().name(); + textColor = mWidget->palette().text().color().name(); mWidget->setStyleSheet( QString( ".QWidget{" "border: 1px solid %1;" @@ -131,7 +132,8 @@ void QgsMapTip::showMapTip( QgsMapLayer *pLayer, bodyStyle = QString( "background-color: %1;" "margin: 0;" - "font: %2pt \"%3\";" ).arg( backgroundColor ).arg( mFontSize ).arg( mFontFamily ); + "font: %2pt \"%3\";" + "color: %4;" ).arg( backgroundColor ).arg( mFontSize ).arg( mFontFamily ).arg( textColor ); containerStyle = QString( "display: inline-block;"