From b6dd62facb353a8596a11e9f0c9db878666666ec Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Sat, 9 Dec 2017 09:48:37 +0100 Subject: [PATCH] [hidpi] Apply UI_SCALE_FACTOR multiplier to font metrics On windows too. --- src/gui/qgscolorrampbutton.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/qgscolorrampbutton.cpp b/src/gui/qgscolorrampbutton.cpp index 5f4c5abee67..d086929a3bb 100644 --- a/src/gui/qgscolorrampbutton.cpp +++ b/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( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height( ), 22.0 ) ) ); #else // Adjust height for HiDPI screens - return QSize( 120, std::max( static_cast( fontMetrics().height( ) * 1.4 ), 28 ) ); + return QSize( 120, static_cast( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height( ) * 1.4, 28.0 ) ) ); #endif }