Skip to content

Commit

Permalink
[maptip] Fix illegible map tips with dark themes (fixes #32288)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored and nyalldawson committed Oct 25, 2019
1 parent 16676ff commit 01e4849
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgsmaptip.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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;"
Expand All @@ -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;"
Expand Down

0 comments on commit 01e4849

Please sign in to comment.