From 379190d28b8e15882bbdaf0885c731f481c3cf8e Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 2 Jul 2019 19:16:00 +1000 Subject: [PATCH] Lighten proj text color --- src/gui/qgsdatumtransformdialog.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/qgsdatumtransformdialog.cpp b/src/gui/qgsdatumtransformdialog.cpp index 11412c8a0724..1d1d3993d042 100644 --- a/src/gui/qgsdatumtransformdialog.cpp +++ b/src/gui/qgsdatumtransformdialog.cpp @@ -210,9 +210,15 @@ void QgsDatumTransformDialog::load( QPair selectedDatumTransforms, con opText[k] = QStringLiteral( "
  • %1
  • " ).arg( opText.at( k ) ); } + const QColor disabled = palette().color( QPalette::Disabled, QPalette::Text ); + const QColor active = palette().color( QPalette::Active, QPalette::Text ); + + const QColor codeColor( static_cast< int >( active.red() * 0.6 + disabled.red() * 0.4 ), + static_cast< int >( active.green() * 0.6 + disabled.green() * 0.4 ), + static_cast< int >( active.blue() * 0.6 + disabled.blue() * 0.4 ) ); const QString toolTipString = QStringLiteral( "%1" ).arg( transform.name ) + ( !opText.empty() ? ( opText.count() == 1 ? QStringLiteral( "

    %1

    " ).arg( opText.at( 0 ) ) : QStringLiteral( "" ).arg( opText.join( QString() ) ) ) : QString() ) + - QStringLiteral( "

    %2

    " ).arg( transform.proj ); + QStringLiteral( "

    %2

    " ).arg( codeColor.name(), transform.proj ); #else const QString toolTipString = QStringLiteral( "%1

    %2

    " ).arg( transform.name, transform.proj ); #endif