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 }