Skip to content

Commit

Permalink
Lighten proj text color
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 2, 2019
1 parent 766e58a commit 379190d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/qgsdatumtransformdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,15 @@ void QgsDatumTransformDialog::load( QPair<int, int> selectedDatumTransforms, con
opText[k] = QStringLiteral( "<li>%1</li>" ).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( "<b>%1</b>" ).arg( transform.name )
+ ( !opText.empty() ? ( opText.count() == 1 ? QStringLiteral( "<p>%1</p>" ).arg( opText.at( 0 ) ) : QStringLiteral( "<ul>%1</ul>" ).arg( opText.join( QString() ) ) ) : QString() ) +
QStringLiteral( "<p><code>%2</code></p>" ).arg( transform.proj );
QStringLiteral( "<p><code style=\"color: %1\">%2</code></p>" ).arg( codeColor.name(), transform.proj );
#else
const QString toolTipString = QStringLiteral( "<b>%1</b><p><code>%2</code></p>" ).arg( transform.name, transform.proj );
#endif
Expand Down

0 comments on commit 379190d

Please sign in to comment.