Skip to content
Permalink
Browse files

[hidpi] Apply UI_SCALE_FACTOR multiplier to font metrics

On windows too.
  • Loading branch information
elpaso committed Dec 9, 2017
1 parent 251b2ae commit b6dd62facb353a8596a11e9f0c9db878666666ec
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/qgscolorrampbutton.cpp
@@ -67,10 +67,10 @@ QSize QgsColorRampButton::sizeHint() const
{
//make sure height of button looks good under different platforms
#ifdef Q_OS_WIN
return QSize( 120, 22 );
return QSize( 120, static_cast<int>( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height( ), 22.0 ) ) );
#else
// Adjust height for HiDPI screens
return QSize( 120, std::max( static_cast<int>( fontMetrics().height( ) * 1.4 ), 28 ) );
return QSize( 120, static_cast<int>( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height( ) * 1.4, 28.0 ) ) );
#endif
}

0 comments on commit b6dd62f

Please sign in to comment.
You can’t perform that action at this time.