Skip to content

Commit

Permalink
[hidpi] Apply UI_SCALE_FACTOR multiplier to font metrics
Browse files Browse the repository at this point in the history
On windows too.
  • Loading branch information
elpaso committed Dec 9, 2017
1 parent 251b2ae commit b6dd62f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/qgscolorrampbutton.cpp
Expand Up @@ -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
}

Expand Down

0 comments on commit b6dd62f

Please sign in to comment.